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

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, ...@@ -167,7 +167,8 @@ gimp_drawable_bucket_fill (GimpDrawable *drawable,
buffer = gimp_fill_options_create_buffer (options, drawable, buffer = gimp_fill_options_create_buffer (options, drawable,
GEGL_RECTANGLE (0, 0, GEGL_RECTANGLE (0, 0,
width, height)); width, height),
-x, -y);
gimp_gegl_apply_opacity (buffer, NULL, NULL, buffer, gimp_gegl_apply_opacity (buffer, NULL, NULL, buffer,
mask_buffer, mask_buffer,
......
...@@ -75,7 +75,8 @@ gimp_drawable_edit_fill (GimpDrawable *drawable, ...@@ -75,7 +75,8 @@ gimp_drawable_edit_fill (GimpDrawable *drawable,
buffer = gimp_fill_options_create_buffer (options, drawable, buffer = gimp_fill_options_create_buffer (options, drawable,
GEGL_RECTANGLE (0, 0, GEGL_RECTANGLE (0, 0,
width, height)); width, height),
-x, -y);
if (! undo_desc) if (! undo_desc)
undo_desc = gimp_fill_options_get_undo_desc (options); undo_desc = gimp_fill_options_get_undo_desc (options);
......
...@@ -249,7 +249,8 @@ gimp_drawable_fill_scan_convert (GimpDrawable *drawable, ...@@ -249,7 +249,8 @@ gimp_drawable_fill_scan_convert (GimpDrawable *drawable,
gimp_fill_options_get_antialias (options)); gimp_fill_options_get_antialias (options));
buffer = gimp_fill_options_create_buffer (options, drawable, 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, gimp_gegl_apply_opacity (buffer, NULL, NULL, buffer,
mask_buffer, 0, 0, 1.0); mask_buffer, 0, 0, 1.0);
......
...@@ -407,7 +407,9 @@ gimp_fill_options_get_undo_desc (GimpFillOptions *options) ...@@ -407,7 +407,9 @@ gimp_fill_options_get_undo_desc (GimpFillOptions *options)
GeglBuffer * GeglBuffer *
gimp_fill_options_create_buffer (GimpFillOptions *options, gimp_fill_options_create_buffer (GimpFillOptions *options,
GimpDrawable *drawable, GimpDrawable *drawable,
const GeglRectangle *rect) const GeglRectangle *rect,
gint pattern_offset_x,
gint pattern_offset_y)
{ {
GeglBuffer *buffer; GeglBuffer *buffer;
...@@ -443,7 +445,9 @@ gimp_fill_options_create_buffer (GimpFillOptions *options, ...@@ -443,7 +445,9 @@ gimp_fill_options_create_buffer (GimpFillOptions *options,
pattern = gimp_context_get_pattern (GIMP_CONTEXT (options)); pattern = gimp_context_get_pattern (GIMP_CONTEXT (options));
gimp_drawable_fill_buffer (drawable, buffer, gimp_drawable_fill_buffer (drawable, buffer,
NULL, pattern, 0, 0); NULL, pattern,
pattern_offset_x,
pattern_offset_y);
} }
break; break;
} }
......
...@@ -73,7 +73,9 @@ const gchar * gimp_fill_options_get_undo_desc (GimpFillOptions *optio ...@@ -73,7 +73,9 @@ const gchar * gimp_fill_options_get_undo_desc (GimpFillOptions *optio
GeglBuffer * gimp_fill_options_create_buffer (GimpFillOptions *options, GeglBuffer * gimp_fill_options_create_buffer (GimpFillOptions *options,
GimpDrawable *drawable, GimpDrawable *drawable,
const GeglRectangle *rect); const GeglRectangle *rect,
gint pattern_offset_x,
gint pattern_offset_y);
#endif /* __GIMP_FILL_OPTIONS_H__ */ #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