[gnome-sudoku/arnaudb/wip/gtk4: 35/43] Make things work.




commit d3cbac9e5a74fc5c6ded424c61e9627a82d50369
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Fri Apr 17 23:18:38 2020 +0200

    Make things work.

 src/sudoku-view.vala | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/src/sudoku-view.vala b/src/sudoku-view.vala
index 4e826f2..ead0f6c 100644
--- a/src/sudoku-view.vala
+++ b/src/sudoku-view.vala
@@ -127,6 +127,12 @@ private class SudokuCellView : Widget
         game.cell_changed.connect (cell_changed_cb);
     }
 
+    protected override void snapshot (Gtk.Snapshot snap)
+    {
+        drawing.queue_draw ();
+        base.snapshot (snap);
+    }
+
     private inline void init_mouse ()  // called on construct
     {
         click_controller = new Gtk.GestureClick ();
@@ -509,6 +515,15 @@ public class SudokuView : Widget
         }
     }
 
+    protected override void snapshot (Gtk.Snapshot snap)
+    {
+        drawing.queue_draw ();
+        for (uint8 i = 0; i < game.board.cols; i++)
+            for (uint8 j = 0; j < game.board.rows; j++)
+                cells[i, j].queue_draw ();
+        base.snapshot (snap);
+    }
+
     public SudokuView (SudokuGame game)
     {
         BinLayout layout = new BinLayout ();
@@ -599,7 +614,7 @@ public class SudokuView : Widget
 
                     this.update_highlights ();
                     // Redraw the board
-                    this.queue_draw ();
+                    queue_draw ();
                 });
 
                 cells[row, col] = cell;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]