chiark / gitweb /
Patch from Ben Hutchings to allow user-initiated tilesize changes to persist
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Sat, 3 Mar 2007 23:17:35 +0000 (23:17 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Sat, 3 Mar 2007 23:17:35 +0000 (23:17 +0000)
across changes in game parameters (e.g., changing difficulty without changing
size). This also has the effect of preserving the user-selected tilesize if the
grid size is changed. (From Debian bug#379452.)

[originally from svn r7368]

midend.c

index 779ca0c811a3e48fc450e680e27fa301a39aa059..d0bc950490871e813056a41dc5191a534ff4b8bc 100644 (file)
--- a/midend.c
+++ b/midend.c
@@ -264,6 +264,8 @@ void midend_size(midend *me, int *x, int *y, int expand)
      */
 
     me->tilesize = min;
+    if (expand)
+        me->preferred_tilesize = me->tilesize;
     midend_size_new_drawstate(me);
     *x = me->winwidth;
     *y = me->winheight;