ref: ebb079eca0717971fa9e4bd30949d0a6a5de3636
parent: 1e8169ea94da3c37fc8fbe38ccb8120ae540743a
author: Simon Tatham <[email protected]>
date: Fri Oct 28 17:32:14 EDT 2022
Loopy: make line thicknesses scale with the canvas. This is now important due to Ben's changes in the web frontend. On high-DPI displays, the canvas is the same overall size as before, but it's scaled up by increasing the game's tilesize rather than the browser scaling the image after the game redraws. Loopy ought to have been scaling its line thicknesses all along, but forgot. Easily fixed.
--- a/loopy.c
+++ b/loopy.c
@@ -3295,7 +3295,7 @@
if (draw_faint_lines)
draw_line(dr, x1, y1, x2, y2, line_colour);
} else {
- draw_thick_line(dr, 3.0,
+ draw_thick_line(dr, ds->tilesize*3/32.0,
x1 + 0.5, y1 + 0.5,
x2 + 0.5, y2 + 0.5,
line_colour);
@@ -3310,7 +3310,7 @@
int x, y;
grid_to_screen(ds, g, d->x, d->y, &x, &y);
- draw_circle(dr, x, y, 2, COL_FOREGROUND, COL_FOREGROUND);
+ draw_circle(dr, x, y, ds->tilesize*2/32.0, COL_FOREGROUND, COL_FOREGROUND);
}
static bool boxes_intersect(int x0, int y0, int w0, int h0,