[gimp] Bug 784802 - Crop and rectangle-select tools incorrectly detect ...



commit 6b4abf7b4cc834c61931cc7171515d1ed0f5dea5
Author: Ell <ell_se yahoo com>
Date:   Sun Feb 25 10:15:59 2018 -0500

    Bug 784802 - Crop and rectangle-select tools incorrectly detect ...
    
    ... current aspect ratio
    
    In gimp_{rectangle_select,crop}_tool_start(), move
    GimpToolRectangle signal connection to the end of the function.  In
    particular, connect the signals *after* the call to
    gimp_{rectangle_select,crop}_tool_update_option_defaults(), since
    it may result in an emission of a "change-complete" signal, whose
    handler calls the function again with ignore_pending == FALSE, which
    would override the ratio set with ignore_pending == TRUE.

 app/tools/gimpcroptool.c            |   20 ++++++++++----------
 app/tools/gimprectangleselecttool.c |   14 +++++++-------
 2 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/app/tools/gimpcroptool.c b/app/tools/gimpcroptool.c
index c008f97..7c3176e 100644
--- a/app/tools/gimpcroptool.c
+++ b/app/tools/gimpcroptool.c
@@ -398,16 +398,6 @@ gimp_crop_tool_start (GimpCropTool *crop_tool,
       crop_tool->bindings = g_list_prepend (crop_tool->bindings, binding);
     }
 
-  g_signal_connect (widget, "changed",
-                    G_CALLBACK (gimp_crop_tool_rectangle_changed),
-                    crop_tool);
-  g_signal_connect (widget, "response",
-                    G_CALLBACK (gimp_crop_tool_rectangle_response),
-                    crop_tool);
-  g_signal_connect (widget, "change-complete",
-                    G_CALLBACK (gimp_crop_tool_rectangle_change_complete),
-                    crop_tool);
-
   gimp_rectangle_options_connect (GIMP_RECTANGLE_OPTIONS (options),
                                   gimp_display_get_image (shell->display),
                                   G_CALLBACK (gimp_crop_tool_auto_shrink),
@@ -418,6 +408,16 @@ gimp_crop_tool_start (GimpCropTool *crop_tool,
 
   gimp_crop_tool_update_option_defaults (crop_tool, TRUE);
 
+  g_signal_connect (widget, "changed",
+                    G_CALLBACK (gimp_crop_tool_rectangle_changed),
+                    crop_tool);
+  g_signal_connect (widget, "response",
+                    G_CALLBACK (gimp_crop_tool_rectangle_response),
+                    crop_tool);
+  g_signal_connect (widget, "change-complete",
+                    G_CALLBACK (gimp_crop_tool_rectangle_change_complete),
+                    crop_tool);
+
   gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
 }
 
diff --git a/app/tools/gimprectangleselecttool.c b/app/tools/gimprectangleselecttool.c
index 1948086..aa670bd 100644
--- a/app/tools/gimprectangleselecttool.c
+++ b/app/tools/gimprectangleselecttool.c
@@ -741,13 +741,6 @@ gimp_rectangle_select_tool_start (GimpRectangleSelectTool *rect_tool,
       private->bindings = g_list_prepend (private->bindings, binding);
     }
 
-  g_signal_connect (widget, "response",
-                    G_CALLBACK (gimp_rectangle_select_tool_rectangle_response),
-                    rect_tool);
-  g_signal_connect (widget, "change-complete",
-                    G_CALLBACK (gimp_rectangle_select_tool_rectangle_change_complete),
-                    rect_tool);
-
   gimp_rectangle_options_connect (GIMP_RECTANGLE_OPTIONS (options),
                                   gimp_display_get_image (shell->display),
                                   G_CALLBACK (gimp_rectangle_select_tool_auto_shrink),
@@ -755,6 +748,13 @@ gimp_rectangle_select_tool_start (GimpRectangleSelectTool *rect_tool,
 
   gimp_rectangle_select_tool_update_option_defaults (rect_tool, TRUE);
 
+  g_signal_connect (widget, "response",
+                    G_CALLBACK (gimp_rectangle_select_tool_rectangle_response),
+                    rect_tool);
+  g_signal_connect (widget, "change-complete",
+                    G_CALLBACK (gimp_rectangle_select_tool_rectangle_change_complete),
+                    rect_tool);
+
   gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
 }
 


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