[gimp/metadata-browser] app: same ERASE mode fix for gimp_edit_clear()
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] app: same ERASE mode fix for gimp_edit_clear()
- Date: Thu, 13 Sep 2012 00:18:33 +0000 (UTC)
commit be6ff186667860cc3fdc07d9e46366da4a807195
Author: Michael Natterer <mitch gimp org>
Date: Sun May 20 17:32:43 2012 +0200
app: same ERASE mode fix for gimp_edit_clear()
app/core/gimp-edit.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c
index c1ed1ba..b6b027b 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"));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]