[gimp] Bug 745313 - Description of Equalize wrong in PDB
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 745313 - Description of Equalize wrong in PDB
- Date: Fri, 4 Nov 2016 21:29:37 +0000 (UTC)
commit 7c2bfd3246627644fdcc1192fa5f84f7c3149c0d
Author: Michael Natterer <mitch gimp org>
Date: Fri Nov 4 22:27:39 2016 +0100
Bug 745313 - Description of Equalize wrong in PDB
gimp_drawable_equalize(): is mask_only is FALSE, suspend the selection
around gimp_drawable_apply_operation() so the operation affects the
entire drawable.
app/core/gimpdrawable-equalize.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpdrawable-equalize.c b/app/core/gimpdrawable-equalize.c
index 01720a9..d8a5e46 100644
--- a/app/core/gimpdrawable-equalize.c
+++ b/app/core/gimpdrawable-equalize.c
@@ -27,6 +27,8 @@
#include "gimpdrawable-histogram.h"
#include "gimpdrawable-operation.h"
#include "gimphistogram.h"
+#include "gimpimage.h"
+#include "gimpselection.h"
#include "gimp-intl.h"
@@ -35,12 +37,17 @@ void
gimp_drawable_equalize (GimpDrawable *drawable,
gboolean mask_only)
{
+ GimpImage *image;
+ GimpChannel *selection;
GimpHistogram *hist;
GeglNode *equalize;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
+ image = gimp_item_get_image (GIMP_ITEM (drawable));
+ selection = gimp_image_get_mask (image);
+
hist = gimp_histogram_new (TRUE);
gimp_drawable_calculate_histogram (drawable, hist);
@@ -49,10 +56,16 @@ gimp_drawable_equalize (GimpDrawable *drawable,
"histogram", hist,
NULL);
+ if (! mask_only)
+ gimp_selection_suspend (GIMP_SELECTION (selection));
+
gimp_drawable_apply_operation (drawable, NULL,
C_("undo-type", "Equalize"),
equalize);
+ if (! mask_only)
+ gimp_selection_resume (GIMP_SELECTION (selection));
+
g_object_unref (equalize);
g_object_unref (hist);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]