[gthumb] crop tool: wrong initial selection size



commit c3f275ad9d4e5f60c3545d068f6a9ca3f509e185
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Jan 10 19:03:27 2019 +0100

    crop tool: wrong initial selection size

 gthumb/gth-image-selector.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/gthumb/gth-image-selector.c b/gthumb/gth-image-selector.c
index 271f286c..af3ed25f 100644
--- a/gthumb/gth-image-selector.c
+++ b/gthumb/gth-image-selector.c
@@ -1564,6 +1564,16 @@ selection_is_valid (GthImageSelector *self)
 }
 
 
+static void
+update_selection (GthImageSelector *self)
+{
+       cairo_rectangle_int_t selection;
+
+       gth_image_selector_get_selection (self, &selection);
+       set_selection (self, selection, TRUE);
+}
+
+
 static void
 gth_image_selector_image_changed (GthImageViewerTool *base)
 {
@@ -1589,17 +1599,15 @@ gth_image_selector_image_changed (GthImageViewerTool *base)
 
        if (! selection_is_valid (self))
                init_selection (self);
+       else
+               update_selection (self);
 }
 
 
 static void
 gth_image_selector_zoom_changed (GthImageViewerTool *base)
 {
-       GthImageSelector      *self = GTH_IMAGE_SELECTOR (base);
-       cairo_rectangle_int_t  selection;
-
-       gth_image_selector_get_selection (self, &selection);
-       set_selection (self, selection, TRUE);
+       update_selection (GTH_IMAGE_SELECTOR (base));
 }
 
 


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