[gnome-photos] tool-crop: Create the surface after the correct zoom factor is known
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] tool-crop: Create the surface after the correct zoom factor is known
- Date: Thu, 11 Feb 2016 10:10:18 +0000 (UTC)
commit 3d1ef3c6786c213ef783c9e28d5ca33001d5a059
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 | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-tool-crop.c b/src/photos-tool-crop.c
index 24686cd..51d186e 100644
--- a/src/photos-tool-crop.c
+++ b/src/photos-tool-crop.c
@@ -1,6 +1,6 @@
/*
* Photos - access, organize and share your photos on GNOME
- * Copyright © 2015 Red Hat, Inc.
+ * Copyright © 2015, 2016 Red Hat, Inc.
* Copyright © 2015 Umang Jain
* Copyright © 2011, 2012, 2013, 2014, 2015 Yorba Foundation
*
@@ -868,6 +868,8 @@ photos_tool_crop_process (GObject *source_object, GAsyncResult *res, gpointer us
goto out;
}
+ photos_tool_crop_surface_create (self);
+
zoom = gegl_gtk_view_get_zoom (GEGL_GTK_VIEW (self->view));
self->crop_height *= zoom;
self->crop_width *= zoom;
@@ -933,7 +935,6 @@ photos_tool_crop_activate (PhotosTool *tool, PhotosBaseItem *item, GeglGtkView *
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",
@@ -968,6 +969,7 @@ photos_tool_crop_activate (PhotosTool *tool, PhotosBaseItem *item, GeglGtkView *
}
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]