app: in GimpFlipTool, stop drawing before initializing tool

... so that it doesn't clash with GimpTransformTool's logic, causing
CRITICALs.
This commit is contained in:
Ell 2017-09-20 07:41:46 -04:00
parent ee3ecb7833
commit 589e27bf0c
1 changed files with 18 additions and 0 deletions

View File

@ -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,