gimp r25631 - in branches/gimp-2-4: . app/tools



Author: martinn
Date: Sat May 10 19:23:54 2008
New Revision: 25631
URL: http://svn.gnome.org/viewvc/gimp?rev=25631&view=rev

Log:
2008-05-10  Martin Nordholts  <martinn svn gnome org>

	Merged from trunk:

	* app/tools/gimprectangletool.c
	(gimp_rectangle_tool_button_press): Active the tool control
	earlier.
	(gimp_rectangle_tool_synthesize_motion): Bail out if the tool
	control is active, we don't want to synthesize a motion in this
	case as it emits unwanted rectangle-changed signals.


Modified:
   branches/gimp-2-4/ChangeLog
   branches/gimp-2-4/app/tools/gimprectangletool.c

Modified: branches/gimp-2-4/app/tools/gimprectangletool.c
==============================================================================
--- branches/gimp-2-4/app/tools/gimprectangletool.c	(original)
+++ branches/gimp-2-4/app/tools/gimprectangletool.c	Sat May 10 19:23:54 2008
@@ -719,6 +719,8 @@
 
   gimp_draw_tool_pause (draw_tool);
 
+  gimp_tool_control_activate (tool->control);
+
   if (display != tool->display)
     {
       if (gimp_draw_tool_is_active (draw_tool))
@@ -882,8 +884,6 @@
       private->other_side_y = other_side_y;
     }
 
-  gimp_tool_control_activate (tool->control);
-
   gimp_draw_tool_resume (draw_tool);
 }
 
@@ -2081,6 +2081,17 @@
   GimpRectangleToolPrivate *private;
   GimpRectangleFunction     old_function;
 
+  /* We don't want to synthesize motions if the tool control is active
+   * since that means the mouse button is down and the rectangle will
+   * get updated in _motion anyway. The reason we want to prevent this
+   * function from executing is that is emits the rectangle-changed
+   * signal which we don't want in the middle of a rectangle change.
+   */
+  if (gimp_tool_control_is_active (GIMP_TOOL (rectangle)->control))
+    {
+      return;
+    }
+
   private = GIMP_RECTANGLE_TOOL_GET_PRIVATE (rectangle);
 
   old_function = private->function;



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