[gimp] app: Fill Free Select Tool handles when mouse is over them



commit 50525e45432b2223ef6148cb033053d1c7f39271
Author: Martin Nordholts <martinn src gnome org>
Date:   Mon Dec 21 21:27:54 2009 +0100

    app: Fill Free Select Tool handles when mouse is over them
    
    Right now the Free Select Tool vertex handles are shown when the
    cursor is in the proximity. Extend this a bit, so when the cursor is
    _on_ a vertex handle, fill it completely. See bug 598454.

 app/tools/gimpfreeselecttool.c |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/app/tools/gimpfreeselecttool.c b/app/tools/gimpfreeselecttool.c
index 5bae7d8..4d056ea 100644
--- a/app/tools/gimpfreeselecttool.c
+++ b/app/tools/gimpfreeselecttool.c
@@ -1537,8 +1537,9 @@ gimp_free_select_tool_draw (GimpDrawTool *draw_tool)
 
       for (i = 0; i < priv->n_segment_indices; i++)
         {
-          GimpVector2 *point;
-          gdouble      dist;
+          GimpVector2   *point       = NULL;
+          gdouble        dist        = 0.0;
+          GimpHandleType handle_type = -1;
 
           point = &priv->points[priv->segment_indices[i]];
 
@@ -1549,15 +1550,20 @@ gimp_free_select_tool_draw (GimpDrawTool *draw_tool)
                                                        point->x,
                                                        point->y);
 
-          if (dist < POINT_SHOW_THRESHOLD_SQ)
-            {
-              gimp_draw_tool_draw_handle (draw_tool, GIMP_HANDLE_CIRCLE,
-                                          point->x,
-                                          point->y,
-                                          HANDLE_SIZE, HANDLE_SIZE,
-                                          GTK_ANCHOR_CENTER, FALSE);
-
-            }
+          /* If the cursor is over the point, fill, if it's just
+           * close, draw an outline
+           */
+          if (dist < POINT_GRAB_THRESHOLD_SQ)
+            handle_type = GIMP_HANDLE_FILLED_CIRCLE;
+          else if (dist < POINT_SHOW_THRESHOLD_SQ)
+            handle_type = GIMP_HANDLE_CIRCLE;
+
+          if (handle_type != -1)
+            gimp_draw_tool_draw_handle (draw_tool, handle_type,
+                                        point->x,
+                                        point->y,
+                                        HANDLE_SIZE, HANDLE_SIZE,
+                                        GTK_ANCHOR_CENTER, FALSE);
         }
     }
 



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