GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit d244a079 authored by Ell's avatar Ell

app: improve brush outline position when not snapping to stroke

In GimpPaintTool, track the cursor position separately from the
current paint core position, so that the brush outline doesn't lag
behind the cursor while painting.
parent 893990af
Pipeline #150217 passed with stages
in 39 minutes and 32 seconds
......@@ -518,6 +518,9 @@ gimp_paint_tool_paint_motion (GimpPaintTool *paint_tool,
data->coords.x -= off_x;
data->coords.y -= off_y;
paint_tool->cursor_x = data->coords.x;
paint_tool->cursor_y = data->coords.y;
gimp_paint_core_smooth_coords (core, paint_options, &data->coords);
/* Don't paint while the Shift key is pressed for line drawing */
......
......@@ -604,6 +604,9 @@ gimp_paint_tool_oper_update (GimpTool *tool,
core->cur_coords.x -= off_x;
core->cur_coords.y -= off_y;
paint_tool->cursor_x = core->cur_coords.x;
paint_tool->cursor_y = core->cur_coords.y;
if (display == tool->display && (state & GIMP_PAINT_TOOL_LINE_MASK))
{
/* If shift is down and this is not the first paint stroke,
......@@ -704,8 +707,8 @@ gimp_paint_tool_draw (GimpDrawTool *draw_tool)
}
else
{
cur_x = core->cur_coords.x + off_x;
cur_y = core->cur_coords.y + off_y;
cur_x = paint_tool->cursor_x + off_x;
cur_y = paint_tool->cursor_y + off_y;
if (paint_tool->draw_line &&
! gimp_tool_control_is_active (GIMP_TOOL (draw_tool)->control))
......
......@@ -62,6 +62,9 @@ struct _GimpPaintTool
GimpDisplay *display;
GimpDrawable *drawable;
gdouble cursor_x;
gdouble cursor_y;
gdouble paint_x;
gdouble paint_y;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment