chiark / gitweb /
Completion flashes were occasionally failing to be cleaned up if a
authorSimon Tatham <anakin@pobox.com>
Wed, 11 May 2005 13:03:17 +0000 (13:03 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 11 May 2005 13:03:17 +0000 (13:03 +0000)
subsequent move animation began during them. Tracked this to
overenthusiastic use of clip() and fixed it.

[originally from svn r5766]

twiddle.c

index 6c51cb7eabb6aa528fce78ef7f033ce1dfb86a88..7585239ed6125cbc81b16329852414fc89bdbc0c 100644 (file)
--- a/twiddle.c
+++ b/twiddle.c
@@ -693,6 +693,16 @@ static void draw_tile(frontend *fe, game_state *state, int x, int y,
     int coords[8];
     char str[40];
 
+    /*
+     * If we've been passed a rotation region but we're drawing a
+     * tile which is outside it, we must draw it normally. This can
+     * occur if we're cleaning up after a completion flash while a
+     * new move is also being made.
+     */
+    if (rot && (x < rot->cx || y < rot->cy ||
+                x >= rot->cx+rot->cw || y > rot->cy+rot->ch))
+        rot = NULL;
+
     if (rot)
        clip(fe, rot->cx, rot->cy, rot->cw, rot->ch);