Commit 38dcb73b authored by Michael Natterer's avatar Michael Natterer 😴

Issue #2386 - Pattern fill with selection is shifted in 2.10

Add pattern offset parameters to gimp_fill_options_create_buffer() and
pass the selection's top-left corner so that pattern fills on the same
drawable are aligned.
parent 8421221b
......@@ -167,7 +167,8 @@ gimp_drawable_bucket_fill (GimpDrawable *drawable,
buffer = gimp_fill_options_create_buffer (options, drawable,
GEGL_RECTANGLE (0, 0,
width, height));
width, height),
-x, -y);
gimp_gegl_apply_opacity (buffer, NULL, NULL, buffer,
mask_buffer,
......
......@@ -75,7 +75,8 @@ gimp_drawable_edit_fill (GimpDrawable *drawable,
buffer = gimp_fill_options_create_buffer (options, drawable,
GEGL_RECTANGLE (0, 0,
width, height));
width, height),
-x, -y);
if (! undo_desc)
undo_desc = gimp_fill_options_get_undo_desc (options);
......
......@@ -249,7 +249,8 @@ gimp_drawable_fill_scan_convert (GimpDrawable *drawable,
gimp_fill_options_get_antialias (options));
buffer = gimp_fill_options_create_buffer (options, drawable,
GEGL_RECTANGLE (0, 0, w, h));
GEGL_RECTANGLE (0, 0, w, h),
-x, -y);
gimp_gegl_apply_opacity (buffer, NULL, NULL, buffer,
mask_buffer, 0, 0, 1.0);
......
......@@ -407,7 +407,9 @@ gimp_fill_options_get_undo_desc (GimpFillOptions *options)
GeglBuffer *
gimp_fill_options_create_buffer (GimpFillOptions *options,
GimpDrawable *drawable,
const GeglRectangle *rect)
const GeglRectangle *rect,
gint pattern_offset_x,
gint pattern_offset_y)
{
GeglBuffer *buffer;
......@@ -443,7 +445,9 @@ gimp_fill_options_create_buffer (GimpFillOptions *options,
pattern = gimp_context_get_pattern (GIMP_CONTEXT (options));
gimp_drawable_fill_buffer (drawable, buffer,
NULL, pattern, 0, 0);
NULL, pattern,
pattern_offset_x,
pattern_offset_y);
}
break;
}
......
......@@ -73,7 +73,9 @@ const gchar * gimp_fill_options_get_undo_desc (GimpFillOptions *optio
GeglBuffer * gimp_fill_options_create_buffer (GimpFillOptions *options,
GimpDrawable *drawable,
const GeglRectangle *rect);
const GeglRectangle *rect,
gint pattern_offset_x,
gint pattern_offset_y);
#endif /* __GIMP_FILL_OPTIONS_H__ */
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