[gimp] app: GimpPaintTool: don't chain up to start/halt the tool



commit 33c84f38bcd1f547b67f0c4ebe829d70f6198086
Author: Michael Natterer <mitch gimp org>
Date:   Fri Jun 30 16:39:28 2017 +0200

    app: GimpPaintTool: don't chain up to start/halt the tool
    
    because the parent class is about to be refactored a bit, and the
    actual code executed by chaining up is just 4 lines.

 app/tools/gimppainttool.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/app/tools/gimppainttool.c b/app/tools/gimppainttool.c
index ab35f1b..fdc4127 100644
--- a/app/tools/gimppainttool.c
+++ b/app/tools/gimppainttool.c
@@ -340,9 +340,8 @@ gimp_paint_tool_button_press (GimpTool            *tool,
       gimp_paint_core_round_line (core, paint_options, constrain);
     }
 
-  /*  chain up to activate the tool  */
-  GIMP_TOOL_CLASS (parent_class)->button_press (tool, coords, time, state,
-                                                press_type, display);
+  tool->display  = display;
+  tool->drawable = drawable;
 
   /*  pause the current selection  */
   gimp_display_shell_selection_pause (shell);
@@ -367,6 +366,8 @@ gimp_paint_tool_button_press (GimpTool            *tool,
   gimp_display_flush_now (display);
 
   gimp_draw_tool_start (draw_tool, display);
+
+  gimp_tool_control_activate (tool->control);
 }
 
 static void
@@ -392,6 +393,8 @@ gimp_paint_tool_button_release (GimpTool              *tool,
       return;
     }
 
+  gimp_tool_control_halt (tool->control);
+
   gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
 
   /*  Let the specific painting function finish up  */
@@ -401,10 +404,6 @@ gimp_paint_tool_button_release (GimpTool              *tool,
   /*  resume the current selection  */
   gimp_display_shell_selection_resume (shell);
 
-  /*  chain up to halt the tool */
-  GIMP_TOOL_CLASS (parent_class)->button_release (tool, coords, time, state,
-                                                  release_type, display);
-
   if (release_type == GIMP_BUTTON_RELEASE_CANCEL)
     gimp_paint_core_cancel (core, drawable);
   else
@@ -948,7 +947,7 @@ gimp_paint_tool_set_draw_fallback (GimpPaintTool *tool,
   g_return_if_fail (GIMP_IS_PAINT_TOOL (tool));
 
   tool->draw_fallback = draw_fallback;
-  tool->fallback_size= fallback_size;
+  tool->fallback_size = fallback_size;
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]