[gimp] app: simplify gimp_foreground_select_tool_oper_update() a lot



commit cc63337be56d7b26608ef1eb1ca4ecdf72180b4b
Author: Michael Natterer <mitch gimp org>
Date:   Wed Mar 30 20:39:00 2011 +0200

    app: simplify gimp_foreground_select_tool_oper_update() a lot
    
    by removing tons of cruft. Fixes both status messages and tool drawing
    with multiple displays.

 app/tools/gimpforegroundselecttool.c |   46 ++++++---------------------------
 1 files changed, 9 insertions(+), 37 deletions(-)
---
diff --git a/app/tools/gimpforegroundselecttool.c b/app/tools/gimpforegroundselecttool.c
index 21e699b..70ae7d3 100644
--- a/app/tools/gimpforegroundselecttool.c
+++ b/app/tools/gimpforegroundselecttool.c
@@ -282,54 +282,26 @@ gimp_foreground_select_tool_oper_update (GimpTool         *tool,
                                          GimpDisplay      *display)
 {
   GimpForegroundSelectTool *fg_select = GIMP_FOREGROUND_SELECT_TOOL (tool);
-  GimpDrawTool             *draw_tool = GIMP_DRAW_TOOL (tool);
   const gchar              *status    = NULL;
 
-  if (fg_select->mask && gimp_draw_tool_is_active (draw_tool))
-    gimp_draw_tool_stop (draw_tool);
-
-  fg_select->last_coords = *coords;
-
   GIMP_TOOL_CLASS (parent_class)->oper_update (tool, coords, state, proximity,
                                                display);
 
-  if (fg_select->mask)
+  if (fg_select->mask && display == tool->display)
     {
-      switch (GIMP_SELECTION_TOOL (tool)->function)
-        {
-        case SELECTION_SELECT:
-        case SELECTION_MOVE_MASK:
-        case SELECTION_MOVE:
-        case SELECTION_MOVE_COPY:
-        case SELECTION_ANCHOR:
-          if (fg_select->strokes)
-            status = _("Add more strokes or press Enter to accept the selection");
-          else
-            status = _("Mark foreground by painting on the object to extract");
-          break;
-        default:
-          break;
-        }
+      if (fg_select->strokes)
+        status = _("Add more strokes or press Enter to accept the selection");
+      else
+        status = _("Mark foreground by painting on the object to extract");
     }
   else
     {
-      switch (GIMP_SELECTION_TOOL (tool)->function)
-        {
-        case SELECTION_SELECT:
-          status = _("Roughly outline the object to extract");
-          break;
-        default:
-          break;
-        }
+      if (GIMP_SELECTION_TOOL (tool)->function == SELECTION_SELECT)
+        status = _("Roughly outline the object to extract");
     }
 
-  if (proximity)
-    {
-      if (status)
-        gimp_tool_replace_status (tool, display, "%s", status);
-
-      gimp_draw_tool_start (draw_tool, display);
-    }
+  if (proximity && status)
+    gimp_tool_replace_status (tool, display, "%s", status);
 }
 
 static void



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