From e8b160a5e1bbefb589aa201d8c8fe94044ce3b59 Mon Sep 17 00:00:00 2001 From: Jehan Date: Wed, 26 Nov 2025 23:17:33 +0100 Subject: [PATCH] app: reset the scribbles at every new strokes. Every time we press for a selection update, we will start with a blank tri-map, instead of reusing previous "scribbles". In my various tests, it felt like I would get better results this way. Also if you do some mistakes (maybe getting off-border of your object in a previous stroke), it would be much harder to fix, unless you are alway showing the scribbles. One can consider that once you edited the image selection, what is done is done. You don't constantly edit the past, and your resulting selection could have been done with any other selection tool (how it was done doesn't matter anymore). This makes the tool actually stateless in-between strokes. Note that I reset the tri-map at the start of a stroke, rather than at the end. This way, it still allows one to see the previous stroke (it can be useful for verifying how it was done before undoing and retrying). --- app/tools/gimppaintselecttool.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/tools/gimppaintselecttool.c b/app/tools/gimppaintselecttool.c index 6836df27bc..131d955600 100644 --- a/app/tools/gimppaintselecttool.c +++ b/app/tools/gimppaintselecttool.c @@ -231,7 +231,8 @@ gimp_paint_select_tool_button_press (GimpTool *tool, GimpButtonPressType press_type, GimpDisplay *display) { - GimpPaintSelectTool *ps_tool = GIMP_PAINT_SELECT_TOOL (tool); + GimpPaintSelectTool *ps_tool = GIMP_PAINT_SELECT_TOOL (tool); + GeglColor *grey = gegl_color_new ("#888"); if (tool->display && display != tool->display) gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, tool->display); @@ -247,9 +248,14 @@ gimp_paint_select_tool_button_press (GimpTool *tool, ps_tool->last_pos.x = coords->x; ps_tool->last_pos.y = coords->y; + /* Always reset the "scribbles" to start with a blank slate. */ + gegl_buffer_set_color (ps_tool->trimap, NULL, grey); + ps_tool->process = gimp_paint_select_tool_paint_scribble (ps_tool); gimp_tool_control_activate (tool->control); + + g_object_unref (grey); } static void