shithub: puzzles

Download patch

ref: 58769376e54812d5364dea07a0a2e1e7574ba098
parent: fa8cc94e45f953d9f64c4357b133f6884501da1c
author: Simon Tatham <anakin@pobox.com>
date: Mon Aug 16 09:10:07 EDT 2004

Robustness in the face of a completely configurable expansion factor.

[originally from svn r4464]

--- a/rect.c
+++ b/rect.c
@@ -403,9 +403,9 @@
      * generate the base grid.
      */
     params2->w = params->w / (1.0F + params->expandfactor);
-    if (params2->w < 1) params2->w = 1;
-    params2->h = params->h * (1.0F + params->expandfactor);
-    if (params2->h < 1) params2->h = 1;
+    if (params2->w < 2 && params->w >= 2) params2->w = 2;
+    params2->h = params->h / (1.0F + params->expandfactor);
+    if (params2->h < 2 && params->h >= 2) params2->h = 2;
 
     grid = snewn(params2->w * params2->h, int);