[four-in-a-row] Make a method private.



commit 6d8e938c76b0bf06e99dc80439d0eff21ad9f8f2
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat Dec 21 11:40:25 2019 +0100

    Make a method private.

 src/four-in-a-row.vala   |  1 -
 src/game-board-view.vala | 31 ++++++++++++++++++++++---------
 2 files changed, 22 insertions(+), 10 deletions(-)
---
diff --git a/src/four-in-a-row.vala b/src/four-in-a-row.vala
index 042685f..a91b7e8 100644
--- a/src/four-in-a-row.vala
+++ b/src/four-in-a-row.vala
@@ -331,7 +331,6 @@ private class FourInARow : Gtk.Application
             return;
 
         window.show ();
-        game_board_view.refresh_pixmaps ();
         game_board_view.queue_draw ();
         scorebox.update (score, one_player_game);    /* update visible player descriptions */
         prompt_player ();
diff --git a/src/game-board-view.vala b/src/game-board-view.vala
index b68e9f1..9e669af 100644
--- a/src/game-board-view.vala
+++ b/src/game-board-view.vala
@@ -62,7 +62,6 @@ private class GameBoardView : Gtk.DrawingArea {
         offset[Tile.PLAYER2_CURSOR] = tile_size * 5;
 
         refresh_pixmaps();
-        queue_draw();
         return true;
     }
 
@@ -70,7 +69,6 @@ private class GameBoardView : Gtk.DrawingArea {
         load_pixmaps();
 
         refresh_pixmaps();
-        queue_draw();
         return true;
     }
 
@@ -167,14 +165,25 @@ private class GameBoardView : Gtk.DrawingArea {
         cr.restore();
     }
 
-    internal void refresh_pixmaps() {
-        /* scale the pixbufs */
-        Gdk.Pixbuf? pb_tileset_tmp = pb_tileset_raw.scale_simple(tile_size * 6, tile_size, 
Gdk.InterpType.BILINEAR);
-        Gdk.Pixbuf? pb_bground_tmp = pb_bground_raw.scale_simple(board_size, board_size, 
Gdk.InterpType.BILINEAR);
-        if (pb_tileset_tmp == null || pb_bground_tmp == null)
+    /*\
+    * * pixmaps
+    \*/
+
+    private void refresh_pixmaps ()
+    {
+        Gdk.Pixbuf? tmp_pixbuf;
+
+        tmp_pixbuf = pb_tileset_raw.scale_simple (tile_size * 6, tile_size, Gdk.InterpType.BILINEAR);
+        if (tmp_pixbuf == null)
             assert_not_reached ();
-        pb_tileset = (!) pb_tileset_tmp;
-        pb_bground = (!) pb_bground_tmp;
+        pb_tileset = (!) tmp_pixbuf;
+
+        tmp_pixbuf = pb_bground_raw.scale_simple (board_size, board_size, Gdk.InterpType.BILINEAR);
+        if (tmp_pixbuf == null)
+            assert_not_reached ();
+        pb_bground = (!) tmp_pixbuf;
+
+        queue_draw ();
     }
 
     private void load_pixmaps ()
@@ -219,6 +228,10 @@ private class GameBoardView : Gtk.DrawingArea {
         }
     }
 
+    /*\
+    * * mouse play
+    \*/
+
     /**
      * column_clicked:
      *


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