[iagno] Small fix.



commit 9dde8a5c9a6df6fe989647600fecd78c42d747c3
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Jul 15 21:09:18 2019 +0200

    Small fix.
    
    If the mouse is out of the
    board, and the computer is
    playing first, a highlight
    was being requested for an
    invalide position. Fix it.

 src/game-view.vala | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/game-view.vala b/src/game-view.vala
index 1538b1b..59fda65 100644
--- a/src/game-view.vala
+++ b/src/game-view.vala
@@ -1042,7 +1042,9 @@ private class GameView : Gtk.DrawingArea
             if (highlight_x != x || highlight_y != y)
                 queue_draw_tile (highlight_x, highlight_y);
         }
-        if (show_mouse_highlight || force_redraw)
+        if ((show_mouse_highlight || force_redraw)
+         // happens if the mouse is out of the board and the computer starts
+         && (mouse_highlight_x != uint8.MAX && mouse_highlight_y != uint8.MAX))
         {
             queue_draw_tile (mouse_highlight_x, mouse_highlight_y);
         }


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