From 16d9c1f00de6db0d4892b23ea511a3715bc65dbf Mon Sep 17 00:00:00 2001 From: Jehan Date: Sat, 12 Oct 2019 13:12:11 +0200 Subject: [PATCH] =?UTF-8?q?Issue=20#4049:=20Colour=20fill=20on=20Line=20Ar?= =?UTF-8?q?t=20Detection=20misaligned=20when=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … different layer size/location used. We need to use the source coordinate space when generating the first fill buffer, then transform to the target layer coordinate space when applying the drawable filter. --- app/tools/gimpbucketfilltool.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/app/tools/gimpbucketfilltool.c b/app/tools/gimpbucketfilltool.c index 6518a6921a..c6095958d6 100644 --- a/app/tools/gimpbucketfilltool.c +++ b/app/tools/gimpbucketfilltool.c @@ -397,14 +397,20 @@ gimp_bucket_fill_tool_preview (GimpBucketFillTool *tool, } else { + gint source_off_x = 0; + gint source_off_y = 0; + if (options->line_art_source != GIMP_LINE_ART_SOURCE_SAMPLE_MERGED) { - gint off_x, off_y; + GimpPickable *input; - gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y); + input = gimp_line_art_get_input (tool->priv->line_art); + g_return_if_fail (GIMP_IS_ITEM (input)); - x -= (gdouble) off_x; - y -= (gdouble) off_y; + gimp_item_get_offset (GIMP_ITEM (input), &source_off_x, &source_off_y); + + x -= (gdouble) source_off_x; + y -= (gdouble) source_off_y; } fill = gimp_drawable_get_line_art_fill_buffer (drawable, tool->priv->line_art, @@ -414,6 +420,15 @@ gimp_bucket_fill_tool_preview (GimpBucketFillTool *tool, x, y, &tool->priv->fill_mask, &x, &y, NULL, NULL); + if (options->line_art_source != GIMP_LINE_ART_SOURCE_SAMPLE_MERGED) + { + gint off_x, off_y; + + gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y); + + x -= (gdouble) off_x - (gdouble) source_off_x; + y -= (gdouble) off_y - (gdouble) source_off_y; + } } if (fill) {