This is a patch for a tiny little bug in the the aspect calculation of the
rectangle tool (division by zero).

When I fixed the above I also noticed that the center point of the 
rectangle was calculated using integer division even though the center 
coordinates are gdoubles and thus can store the real center. So I 
changed the division by 2 into division by 2.0.

ps. real as in both correct and non-integer!

-- 
/Dennis Björklund
Index: app/tools/gimprectangletool.c
===================================================================
RCS file: /cvs/gnome/gimp/app/tools/gimprectangletool.c,v
retrieving revision 1.30
diff -u -r1.30 gimprectangletool.c
--- app/tools/gimprectangletool.c       4 Feb 2006 05:37:20 -0000       1.30
+++ app/tools/gimprectangletool.c       6 Feb 2006 19:53:31 -0000
@@ -2548,13 +2548,13 @@
   width  = x2 - x1;
   height = y2 - y1;
 
-  if (width > 0.01)
+  if (height > 0.01)
     aspect = width / height;
   else
     aspect = 0;
 
-  center_x = (x1 + x2) / 2;
-  center_y = (y1 + y2) / 2;
+  center_x = (x1 + x2) / 2.0;
+  center_y = (y1 + y2) / 2.0;
 
   g_signal_handlers_block_by_func (entry,
                                    rectangle_dimensions_changed,
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Reply via email to