From 4012f93e62c548ffb4f24277d13f0c93fa72d1a6 Mon Sep 17 00:00:00 2001 From: Jehan Date: Mon, 3 Mar 2025 20:49:05 +0100 Subject: [PATCH] =?UTF-8?q?Issue=20#11251:=20Edit=20->=20Clear=20(Undo)=20?= =?UTF-8?q?does=20not=20clear=20the=20effects=20which=20extend=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … outside the drawable's boundary. --- app/core/gimpdrawable-edit.c | 14 +++++++++++++- app/core/gimpdrawableundo.c | 7 ++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/core/gimpdrawable-edit.c b/app/core/gimpdrawable-edit.c index 217a0cadc2..19ef45633f 100644 --- a/app/core/gimpdrawable-edit.c +++ b/app/core/gimpdrawable-edit.c @@ -194,7 +194,19 @@ gimp_drawable_edit_fill (GimpDrawable *drawable, { gimp_drawable_edit_fill_direct (drawable, options, undo_desc); - gimp_drawable_update (drawable, x, y, width, height); + if (gimp_drawable_has_visible_filters (drawable)) + { + /* For drawables with filters, update the bounding box then + * let the drawable update everything, because the filtered + * render may be bigger than the filled part. + */ + gimp_drawable_update_bounding_box (drawable); + gimp_drawable_update (drawable, 0, 0, -1, -1); + } + else + { + gimp_drawable_update (drawable, x, y, width, height); + } } else { diff --git a/app/core/gimpdrawableundo.c b/app/core/gimpdrawableundo.c index 78b8f3902a..f660ce2bbd 100644 --- a/app/core/gimpdrawableundo.c +++ b/app/core/gimpdrawableundo.c @@ -27,6 +27,7 @@ #include "gimp-memsize.h" #include "gimpimage.h" #include "gimpdrawable.h" +#include "gimpdrawable-filters.h" #include "gimpdrawableundo.h" @@ -186,13 +187,17 @@ gimp_drawable_undo_pop (GimpUndo *undo, GimpUndoAccumulator *accum) { GimpDrawableUndo *drawable_undo = GIMP_DRAWABLE_UNDO (undo); + GimpDrawable *drawable = GIMP_DRAWABLE (GIMP_ITEM_UNDO (undo)->item); GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum); - gimp_drawable_swap_pixels (GIMP_DRAWABLE (GIMP_ITEM_UNDO (undo)->item), + gimp_drawable_swap_pixels (drawable, drawable_undo->buffer, drawable_undo->x, drawable_undo->y); + + if (gimp_drawable_has_visible_filters (drawable)) + gimp_drawable_update (drawable, 0, 0, -1, -1); } static void