[gnome-photos/wip/rishi/crop: 3/4] tool-crop: Clear "reset" earlier in the activation sequence



commit 10729f504960a32f982f9d9e2f1282a062f88384
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Jul 18 20:16:38 2017 +0200

    tool-crop: Clear "reset" earlier in the activation sequence
    
    A subsequent commit will add support for changing the orientation of
    the crop rectangle. For BaseItems without any pre-existing gegl:crop,
    it will set the orientation of the crop to match that of the original
    item. However, it is not allowed to change the crop rectangle if the
    "reset" variable is set.
    
    Therefore, the variable is now cleared earlier.
    
    During the reset sequence, we update "activated" and "reset" in
    separate stages. Therefore it seems to make sense to clear "reset" as
    soon as the "activate" virtual method is called.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781134

 src/photos-tool-crop.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-tool-crop.c b/src/photos-tool-crop.c
index 2dadee7..52045b1 100644
--- a/src/photos-tool-crop.c
+++ b/src/photos-tool-crop.c
@@ -936,7 +936,6 @@ photos_tool_crop_process (GObject *source_object, GAsyncResult *res, gpointer us
                                                     G_CONNECT_SWAPPED);
 
   self->activated = TRUE;
-  self->reset = FALSE;
   g_signal_emit_by_name (self, "activated");
 }
 
@@ -964,6 +963,7 @@ photos_tool_crop_activate (PhotosTool *tool, PhotosBaseItem *item, PhotosImageVi
   got_bbox_source = photos_base_item_get_bbox_source (item, &self->bbox_source);
   g_return_if_fail (got_bbox_source);
 
+  self->reset = FALSE;
   self->view = GTK_WIDGET (view);
 
   if (photos_base_item_operation_get (item,
@@ -1007,7 +1007,6 @@ photos_tool_crop_activate (PhotosTool *tool, PhotosBaseItem *item, PhotosImageVi
                                                         G_CONNECT_SWAPPED);
 
       self->activated = TRUE;
-      self->reset = FALSE;
       g_signal_emit_by_name (self, "activated");
     }
 }


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