From ebb079eca0717971fa9e4bd30949d0a6a5de3636 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 28 Oct 2022 21:32:14 +0100 Subject: [PATCH] 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. --- loopy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loopy.c b/loopy.c index bab5bf2..61a79c2 100644 --- a/loopy.c +++ b/loopy.c @@ -3295,7 +3295,7 @@ static void game_redraw_line(drawing *dr, game_drawstate *ds, 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 @@ static void game_redraw_dot(drawing *dr, game_drawstate *ds, 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,