(patch) Fix for shear UI locking

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

 



The transform tool, when set to shear, will only let you shear in one
direction after trying once and resetting. This very simple patch for
shear_tool.c fixes the problem. (Hope it's in the correct format, it's
small enough to apply by hand if not.)

Patch against 1.1.14, BTW.


-- 
David Hodson  --  hodsond@xxxxxxx  --  this night wounds time
--- shear_tool.c	Wed Dec 29 12:35:32 1999
+++ shear_tool.c.orig	Wed Dec 29 12:30:06 1999
@@ -42,6 +42,7 @@
 #define MIN_MOVE       5
 
 /*  variables local to this file  */
+static gint        direction_unknown;
 static gdouble     xshear_val;
 static gdouble     yshear_val;
 
@@ -86,7 +87,8 @@
 				      shear_y_mag_changed, tool);
 	}
       gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), TRUE);
-      transform_core->trans_info[HORZ_OR_VERT] = ORIENTATION_UNKNOWN;
+      direction_unknown = 1;
+      transform_core->trans_info[HORZ_OR_VERT] = ORIENTATION_HORIZONTAL;
       transform_core->trans_info[XSHEAR] = 0.0;
       transform_core->trans_info[YSHEAR] = 0.0;
 
@@ -105,6 +107,7 @@
 
     case FINISH :
       gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), FALSE);
+      direction_unknown = 1;
       return shear_tool_shear (gdisp->gimage,
 			       gimage_active_drawable (gdisp->gimage),
 			       gdisp,
@@ -231,7 +234,7 @@
    *  decide using the maximum differential
    */
 
-  if (transform_core->trans_info[HORZ_OR_VERT] == ORIENTATION_UNKNOWN)
+  if (direction_unknown)
     {
       if (abs(diffx) > MIN_MOVE || abs(diffy) > MIN_MOVE)
 	{
@@ -246,6 +249,7 @@
 	      transform_core->trans_info[ORIENTATION_HORIZONTAL] = 0.0;
 	    }
 
+	  direction_unknown = 0;
 	}
       /*  set the current coords to the last ones  */
       else
@@ -256,7 +260,7 @@
     }
 
   /*  if the direction is known, keep track of the magnitude  */
-  if (transform_core->trans_info[HORZ_OR_VERT] != ORIENTATION_UNKNOWN)
+  if (!direction_unknown)
     {
       dir = transform_core->trans_info[HORZ_OR_VERT];
       switch (transform_core->function)

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux