mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
Solo: cope with pencil marks when tilesize == 1
Solo's layout calculations for pencil marks could fail with a tilesize of 1, generating an assertion failure: "draw_number: Assertion `pbest > 0' failed." This was reported as Debian bug #905852. My solution is slightly silly, namely to change a ">" in the test for whether a new layout is the best so far to ">=". This allows for finding a (terrible) layout even for tilesize == 1, and also has the side-effect of slightly preserring wide layouts over tall ones. Personally, I think that's an improvement.
This commit is contained in:
2
solo.c
2
solo.c
@ -5133,7 +5133,7 @@ static void draw_number(drawing *dr, game_drawstate *ds,
|
|||||||
fw = (pr - pl) / (float)pw;
|
fw = (pr - pl) / (float)pw;
|
||||||
fh = (pb - pt) / (float)ph;
|
fh = (pb - pt) / (float)ph;
|
||||||
fs = min(fw, fh);
|
fs = min(fw, fh);
|
||||||
if (fs > bestsize) {
|
if (fs >= bestsize) {
|
||||||
bestsize = fs;
|
bestsize = fs;
|
||||||
pbest = pw;
|
pbest = pw;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user