gimp r25630 - in trunk: . app/tools



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

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

	* 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:
   trunk/ChangeLog
   trunk/app/tools/gimprectangletool.c

Modified: trunk/app/tools/gimprectangletool.c
==============================================================================
--- trunk/app/tools/gimprectangletool.c	(original)
+++ trunk/app/tools/gimprectangletool.c	Sat May 10 19:19:47 2008
@@ -841,6 +841,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))
@@ -929,8 +931,6 @@
 
   gimp_rectangle_tool_update_highlight (rect_tool);
 
-  gimp_tool_control_activate (tool->control);
-
   gimp_draw_tool_resume (draw_tool);
 }
 
@@ -2159,6 +2159,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 (rect_tool)->control))
+    {
+      return;
+    }
+ 
   private = GIMP_RECTANGLE_TOOL_GET_PRIVATE (rect_tool);
 
   old_function = private->function;



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