Patch from Ben Hutchings to allow user-initiated tilesize changes to persist
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Sat, 3 Mar 2007 23:17:35 +0000 (23:17 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
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.)

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@7368 cda61777-01e9-0310-a592-d414129be87e

midend.c

index 779ca0c..d0bc950 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;