[gimp] app: in GimpFlipTool, stop drawing before initializing tool
- From: N/A <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: in GimpFlipTool, stop drawing before initializing tool
- Date: Wed, 20 Sep 2017 11:48:33 +0000 (UTC)
commit 589e27bf0cde4e0a56ec4924dbf306feeca3a8f7
Author: Ell <ell_se yahoo com>
Date: Wed Sep 20 07:41:46 2017 -0400
app: in GimpFlipTool, stop drawing before initializing tool
... so that it doesn't clash with GimpTransformTool's logic, causing
CRITICALs.
app/tools/gimpfliptool.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimpfliptool.c b/app/tools/gimpfliptool.c
index fae1889..3df877f 100644
--- a/app/tools/gimpfliptool.c
+++ b/app/tools/gimpfliptool.c
@@ -56,6 +56,9 @@
static GimpDisplay * gimp_flip_tool_has_image (GimpTool *tool,
GimpImage *image);
+static gboolean gimp_flip_tool_initialize (GimpTool *tool,
+ GimpDisplay *display,
+ GError **error);
static void gimp_flip_tool_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
@@ -117,6 +120,7 @@ gimp_flip_tool_class_init (GimpFlipToolClass *klass)
GimpTransformToolClass *trans_class = GIMP_TRANSFORM_TOOL_CLASS (klass);
tool_class->has_image = gimp_flip_tool_has_image;
+ tool_class->initialize = gimp_flip_tool_initialize;
tool_class->modifier_key = gimp_flip_tool_modifier_key;
tool_class->oper_update = gimp_flip_tool_oper_update;
tool_class->cursor_update = gimp_flip_tool_cursor_update;
@@ -155,6 +159,20 @@ gimp_flip_tool_has_image (GimpTool *tool,
return NULL;
}
+static gboolean
+gimp_flip_tool_initialize (GimpTool *tool,
+ GimpDisplay *display,
+ GError **error)
+{
+ GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
+
+ /* let GimpTransformTool take control over the draw tool while it's active */
+ if (gimp_draw_tool_is_active (draw_tool))
+ gimp_draw_tool_stop (draw_tool);
+
+ return GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
+}
+
static void
gimp_flip_tool_modifier_key (GimpTool *tool,
GdkModifierType key,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]