[gnome-tetravex/arnaudb/wip/gtk4: 48/49] Adapt to DrawingArea API.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tetravex/arnaudb/wip/gtk4: 48/49] Adapt to DrawingArea API.
- Date: Wed, 2 Sep 2020 16:07:49 +0000 (UTC)
commit 475ab31f2f09eb55355a048cff8fd8d85d1275aa
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Tue Aug 4 16:21:19 2020 +0200
Adapt to DrawingArea API.
src/puzzle-view.vala | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/puzzle-view.vala b/src/puzzle-view.vala
index d4376f4..de41b21 100644
--- a/src/puzzle-view.vala
+++ b/src/puzzle-view.vala
@@ -196,7 +196,7 @@ private class PuzzleView : Gtk.DrawingArea
init_mouse ();
init_keyboard ();
set_draw_func (draw);
- size_allocate.connect (on_size_allocate);
+ resize.connect (on_resize);
animation_timer.start ();
}
@@ -339,12 +339,10 @@ private class PuzzleView : Gtk.DrawingArea
}
internal const double gap_factor = 0.5;
- private inline void on_size_allocate ()
+ private inline void on_resize (int allocated_width, int allocated_height)
{
if (puzzle_init_done)
{
- int allocated_width = get_allocated_width ();
- int allocated_height = get_allocated_height ();
/* Fit in with a half tile border and spacing between boards */
uint width = (uint) (allocated_width / (2 * puzzle.size + 1.0 + /* 1 × */ gap_factor));
uint height = (uint) (allocated_height / (puzzle.size + 1.0));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]