From 3b0eea51186174f9fba1ec35eb27f36ff4fcab3e Mon Sep 17 00:00:00 2001 From: Pere Pujal i Carabantes Date: Sat, 25 Mar 2023 00:16:02 +0100 Subject: [PATCH] Make stamp outlines be displayed on touchscreens. --- src/tuxpaint.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 846cd3654..f850793f9 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -6228,7 +6228,13 @@ static void mainloop(void) { if (stamp_tool_mode == STAMP_TOOL_MODE_PLACE) { - if (old_x >= 0 && old_y >= 0 && old_x <= r_canvas.w + /* Updating the screen to draw the outlines in touchscreens where there could be touch without previous drag. */ + update_screen(old_x - (CUR_STAMP_W + 1) / 2 + r_canvas.x, + old_y - (CUR_STAMP_H + 1) / 2 + r_canvas.y, + old_x + (CUR_STAMP_W + 1) / 2 + r_canvas.x, + old_y + (CUR_STAMP_H + 1) / 2 + r_canvas.y); + + if (old_x >= 0 && old_y >= 0 && old_x <= r_canvas.w && old_y <= r_canvas.h) { if (!no_stamp_rotation && stamp_rotation_ctrl)