[gimp] Bug 796071 - Clicking outside of a selection frame creates a new, ...



commit e9f2e82cff57004ddb4ac6c91c3fb1244aeb92bc
Author: Michael Natterer <mitch gimp org>
Date:   Sun May 13 22:58:03 2018 +0200

    Bug 796071 - Clicking outside of a selection frame creates a new, ...
    
    ...zero-size selection
    
    Make sure that clicking outside any selection halts the rectangle
    select tool. This fixes ellipse select too.

 app/tools/gimprectangleselecttool.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/app/tools/gimprectangleselecttool.c b/app/tools/gimprectangleselecttool.c
index 60ca8ad..92c0b6b 100644
--- a/app/tools/gimprectangleselecttool.c
+++ b/app/tools/gimprectangleselecttool.c
@@ -584,7 +584,18 @@ gimp_rectangle_select_tool_rectangle_response (GimpToolWidget          *widget,
              *  HALTing it like calling COMMIT would do
              */
             gimp_rectangle_select_tool_commit (rect_tool);
-          }
+
+            gimp_tool_rectangle_get_public_rect (GIMP_TOOL_RECTANGLE (widget),
+                                                 &x1, &y1, &x2, &y2);
+            if (x1 == x2 && y1 == y2)
+              {
+                /*  if there still is no rectangle after the
+                 *  tool_commit(), the click was outside the selection
+                 *  and we HALT to get rid of a zero-size tool widget.
+                 */
+                gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, tool->display);
+              }
+         }
         else
           {
             gimp_tool_control (tool, GIMP_TOOL_ACTION_COMMIT, tool->display);


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