[gimp] app: improve gimp_eraser_tool_is_alpha_only()
- From: N/A <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: improve gimp_eraser_tool_is_alpha_only()
- Date: Tue, 8 May 2018 14:51:07 +0000 (UTC)
commit 3d9bc964233e8b5ce7a79e7c59d2ff0552bcadd2
Author: Ell <ell_se yahoo com>
Date: Tue May 8 10:47:31 2018 -0400
app: improve gimp_eraser_tool_is_alpha_only()
When in anti-erase mode, always return TRUE, since it's only
effective when the drawable has an alpha channel.
Also, remove an unnecessary #include in gimp_ink_tool.c.
app/tools/gimperasertool.c | 7 ++++++-
app/tools/gimpinktool.c | 2 --
2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/app/tools/gimperasertool.c b/app/tools/gimperasertool.c
index bfe2cb8..0b3a438 100644
--- a/app/tools/gimperasertool.c
+++ b/app/tools/gimperasertool.c
@@ -143,7 +143,12 @@ static gboolean
gimp_eraser_tool_is_alpha_only (GimpPaintTool *paint_tool,
GimpDrawable *drawable)
{
- return gimp_drawable_has_alpha (drawable);
+ GimpEraserOptions *options = GIMP_ERASER_TOOL_GET_OPTIONS (paint_tool);
+
+ if (! options->anti_erase)
+ return gimp_drawable_has_alpha (drawable);
+ else
+ return TRUE;
}
diff --git a/app/tools/gimpinktool.c b/app/tools/gimpinktool.c
index fa4ee3f..6cbdd71 100644
--- a/app/tools/gimpinktool.c
+++ b/app/tools/gimpinktool.c
@@ -24,8 +24,6 @@
#include "tools-types.h"
-#include "core/gimpdrawable.h"
-
#include "operations/layer-modes/gimp-layer-modes.h"
#include "paint/gimpinkoptions.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]