[gimp] app: rmove gimp_free_select_tool_update_button_state()



commit efbbe3973405c5b77e2e82d72525dcde13ad6aeb
Author: Michael Natterer <mitch gimp org>
Date:   Sat Apr 2 08:24:24 2011 +0200

    app: rmove gimp_free_select_tool_update_button_state()
    
    and priv->button1_down. Use gimp_tool_control_is_active() instead
    because it now has exactly that meaning.

 app/tools/gimpfreeselecttool.c |   22 ++--------------------
 1 files changed, 2 insertions(+), 20 deletions(-)
---
diff --git a/app/tools/gimpfreeselecttool.c b/app/tools/gimpfreeselecttool.c
index 2fd8ea6..27200f8 100644
--- a/app/tools/gimpfreeselecttool.c
+++ b/app/tools/gimpfreeselecttool.c
@@ -65,9 +65,6 @@ typedef struct
   /* Index of grabbed segment index. */
   gint               grabbed_segment_index;
 
-  /* Wether or not button 1 is down. */
-  gboolean           button1_down;
-
   /* We need to keep track of a number of points when we move a
    * segment vertex
    */
@@ -244,8 +241,6 @@ gimp_free_select_tool_init (GimpFreeSelectTool *fst)
 
   priv->grabbed_segment_index             = INVALID_INDEX;
 
-  priv->button1_down                      = FALSE;
-
   priv->saved_points_lower_segment        = NULL;
   priv->saved_points_higher_segment       = NULL;
   priv->max_n_saved_points_lower_segment  = 0;
@@ -448,15 +443,6 @@ gimp_free_select_tool_revert_to_last_segment (GimpFreeSelectTool *fst)
 }
 
 static void
-gimp_free_select_tool_update_button_state (GimpFreeSelectTool *fst,
-                                           GdkModifierType     state)
-{
-  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
-
-  priv->button1_down = state & GDK_BUTTON1_MASK ? TRUE : FALSE;
-}
-
-static void
 gimp_free_select_tool_remove_last_segment (GimpFreeSelectTool *fst)
 {
   GimpFreeSelectToolPrivate *priv      = GET_PRIVATE (fst);
@@ -1288,8 +1274,6 @@ gimp_free_select_tool_button_press (GimpTool            *tool,
 
   gimp_draw_tool_pause (draw_tool);
 
-  gimp_free_select_tool_update_button_state (fst, state);
-
   if (display != tool->display)
     {
       gimp_free_select_tool_start (fst,
@@ -1349,8 +1333,6 @@ gimp_free_select_tool_button_release (GimpTool              *tool,
 
   gimp_draw_tool_pause (GIMP_DRAW_TOOL (fst));
 
-  gimp_free_select_tool_update_button_state (fst, state);
-
   switch (release_type)
     {
     case GIMP_BUTTON_RELEASE_CLICK:
@@ -1543,7 +1525,7 @@ gimp_free_select_tool_draw (GimpDrawTool *draw_tool)
    * feedback for
    */
   handles_wants_to_show = (hovering_first_point ||
-                           ! priv->button1_down);
+                           ! gimp_tool_control_is_active (tool->control));
 
   if (handles_wants_to_show &&
       ! priv->supress_handles)
@@ -1555,7 +1537,7 @@ gimp_free_select_tool_draw (GimpDrawTool *draw_tool)
        * only draw the first handle, the other handles are not
        * relevant (see comment a few lines up)
        */
-      if (priv->button1_down && hovering_first_point)
+      if (gimp_tool_control_is_active (tool->control) && hovering_first_point)
         n = MIN (priv->n_segment_indices, 1);
       else
         n = priv->n_segment_indices;



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