[gimp] Bug 567393 – Rectangle select tool size shrinks to 0 if size is larger than



commit 05537763ef9f88cdfcccd03e5023b39886d4f9f7
Author: Sven Neumann <sven gimp org>
Date:   Tue Jun 30 23:19:13 2009 +0200

    Bug 567393 â?? Rectangle select tool size shrinks to 0 if size is larger than
    the image and the up or down arrow is pressed.
    
    Applied patch from Massimo as found in bug #567393. This changes ROUND()
    to RINT() to correct rounding for negative numbers. Also did this change
    in gimp_rectangle_tool_adjust_coord().

 app/tools/gimprectangletool.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/app/tools/gimprectangletool.c b/app/tools/gimprectangletool.c
index e88c2e6..f6b1332 100644
--- a/app/tools/gimprectangletool.c
+++ b/app/tools/gimprectangletool.c
@@ -4209,13 +4209,13 @@ gimp_rectangle_tool_update_int_rect (GimpRectangleTool *rect_tool)
 {
   GimpRectangleToolPrivate *priv = GIMP_RECTANGLE_TOOL_GET_PRIVATE (rect_tool);
 
-  priv->x1_int = ROUND (priv->x1);
-  priv->y1_int = ROUND (priv->y1);
+  priv->x1_int = RINT (priv->x1);
+  priv->y1_int = RINT (priv->y1);
 
   if (gimp_rectangle_tool_rect_rubber_banding_func (rect_tool))
     {
-      priv->width_int  = ROUND (priv->x2) - priv->x1_int;
-      priv->height_int = ROUND (priv->y2) - priv->y1_int;
+      priv->width_int  = (gint) RINT (priv->x2) - priv->x1_int;
+      priv->height_int = (gint) RINT (priv->y2) - priv->y1_int;
     }
 }
 
@@ -4286,8 +4286,8 @@ gimp_rectangle_tool_adjust_coord (GimpRectangleTool *rect_tool,
   switch (priv->precision)
     {
       case GIMP_RECTANGLE_PRECISION_INT:
-        *coord_x_output = ROUND (coord_x_input);
-        *coord_y_output = ROUND (coord_y_input);
+        *coord_x_output = RINT (coord_x_input);
+        *coord_y_output = RINT (coord_y_input);
         break;
 
       case GIMP_RECTANGLE_PRECISION_DOUBLE:



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