From 0d636a3561950786d11d405c59920abf369cf1e3 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sun, 20 May 2012 17:32:43 +0200 Subject: [PATCH] app: same ERASE mode fix for gimp_edit_clear() --- app/core/gimp-edit.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c index c1ed1ba03f..b6b027b1a7 100644 --- a/app/core/gimp-edit.c +++ b/app/core/gimp-edit.c @@ -372,7 +372,8 @@ gimp_edit_clear (GimpImage *image, GimpDrawable *drawable, GimpContext *context) { - GimpRGB background; + GimpRGB background; + GimpLayerModeEffects paint_mode; g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE); @@ -381,9 +382,14 @@ gimp_edit_clear (GimpImage *image, gimp_context_get_background (context, &background); + if (gimp_drawable_has_alpha (drawable)) + paint_mode = GIMP_ERASE_MODE; + else + paint_mode = GIMP_NORMAL_MODE; + return gimp_edit_fill_full (image, drawable, &background, NULL, - GIMP_OPACITY_OPAQUE, GIMP_ERASE_MODE, + GIMP_OPACITY_OPAQUE, paint_mode, C_("undo-type", "Clear")); }