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.
This commit is contained in:
Michael Natterer
2018-10-22 16:39:19 +02:00
parent 8421221b60
commit 38dcb73bfc
5 changed files with 15 additions and 6 deletions

View File

@ -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,

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -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__ */