[gnome-photos/wip/rishi/imageview: 8/9] tool-crop: Create the surface after the correct zoom factor is known



commit 3f8de100a9b777669edc11a8f4fbc74701df85ca
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Feb 4 13:32:37 2016 +0100

    tool-crop: Create the surface after the correct zoom factor is known
    
    When revisiting a cropped item (ie. the item's pipeline already has
    gegl:crop in it), we remove the cropping constraints so that we can
    display the item in its entirety. Therefore, we should use the view's
    zoom after the constraints have been removed, not before. Otherwise,
    the zoom factor known to the tool won't match that of the view it is
    actually drawing on.

 src/photos-tool-crop.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-tool-crop.c b/src/photos-tool-crop.c
index ba79c36..a98688b 100644
--- a/src/photos-tool-crop.c
+++ b/src/photos-tool-crop.c
@@ -857,6 +857,8 @@ photos_tool_crop_process (GObject *source_object, GAsyncResult *res, gpointer us
       goto out;
     }
 
+  photos_tool_crop_surface_create (self);
+
   zoom = photos_image_view_get_zoom (PHOTOS_IMAGE_VIEW (self->view));
   self->crop_height *= zoom;
   self->crop_width *= zoom;
@@ -922,7 +924,6 @@ photos_tool_crop_activate (PhotosTool *tool, PhotosBaseItem *item, PhotosImageVi
   g_return_if_fail (got_bbox_source);
 
   self->view = GTK_WIDGET (view);
-  photos_tool_crop_surface_create (self);
 
   if (photos_base_item_operation_get (item,
                                       "gegl:crop",
@@ -957,6 +958,7 @@ photos_tool_crop_activate (PhotosTool *tool, PhotosBaseItem *item, PhotosImageVi
     }
   else
     {
+      photos_tool_crop_surface_create (self);
       photos_tool_crop_init_crop (self);
     }
 


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