aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2022-10-28 22:35:22 +0100
committerSimon Tatham <anakin@pobox.com>2022-10-28 22:35:22 +0100
commitea4ba47662269fef9ae589c285659ee2f06a0b17 (patch)
tree90ecc1b748cdddb95ae90ab425268a8004a9f35f
parentebb079eca0717971fa9e4bd30949d0a6a5de3636 (diff)
downloadpuzzles-ea4ba47662269fef9ae589c285659ee2f06a0b17.zip
puzzles-ea4ba47662269fef9ae589c285659ee2f06a0b17.tar.gz
puzzles-ea4ba47662269fef9ae589c285659ee2f06a0b17.tar.bz2
puzzles-ea4ba47662269fef9ae589c285659ee2f06a0b17.tar.xz
Loopy: adjust clip rectangle for new line thickness.
It would have helped in the previous commit if I'd tried actually _playing_ the game, not just admiring it in its initial state. When I did, I found that lines weren't being fully overdrawn, which turned out to be because the clip rectangle was being set too narrow.
-rw-r--r--loopy.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/loopy.c b/loopy.c
index 61a79c2..b7fb296 100644
--- a/loopy.c
+++ b/loopy.c
@@ -3231,10 +3231,10 @@ static void edge_bbox(game_drawstate *ds, grid *g, grid_edge *e,
grid_to_screen(ds, g, x1, y1, &x1, &y1);
grid_to_screen(ds, g, x2, y2, &x2, &y2);
/* Allow extra margin for dots, and thickness of lines */
- xmin = min(x1, x2) - 2;
- xmax = max(x1, x2) + 2;
- ymin = min(y1, y2) - 2;
- ymax = max(y1, y2) + 2;
+ xmin = min(x1, x2) - (ds->tilesize + 15) / 16;
+ xmax = max(x1, x2) + (ds->tilesize + 15) / 16;
+ ymin = min(y1, y2) - (ds->tilesize + 15) / 16;
+ ymax = max(y1, y2) + (ds->tilesize + 15) / 16;
*x = xmin;
*y = ymin;