[gnome-photos/wip/rishi/crop: 1/3] 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/wip/rishi/crop: 1/3] tool-crop: Create the surface after the correct zoom factor is known
- Date: Tue, 9 Feb 2016 15:54:19 +0000 (UTC)
commit 5f38e95c386b7d134ad0ca60dca96e891f83446a
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 a1fad27..bbc926c 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
*
@@ -857,6 +857,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;
@@ -922,7 +924,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",
@@ -957,6 +958,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]