[gnome-photos/wip/baedert/gtkimageview] crop-tool: Fix redraw_damaged_area



commit adf5489326c96760c5913d3aa051b93583c12056
Author: Timm Bäder <mail baedert org>
Date:   Sat Apr 16 20:04:44 2016 +0200

    crop-tool: Fix redraw_damaged_area

 src/photos-tool-crop.c |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)
---
diff --git a/src/photos-tool-crop.c b/src/photos-tool-crop.c
index 7120e77..ad51781 100644
--- a/src/photos-tool-crop.c
+++ b/src/photos-tool-crop.c
@@ -197,19 +197,14 @@ photos_tool_crop_find_constraint (PhotosToolCrop *self, gdouble aspect_ratio)
 static void
 photos_tool_crop_redraw_damaged_area (PhotosToolCrop *self)
 {
-  gtk_widget_queue_draw (GTK_WIDGET (self->view));
-#if 0
   cairo_rectangle_int_t area;
   cairo_region_t *region;
   gdouble damage_offset = HANDLE_OFFSET + HANDLE_RADIUS;
   gdouble x;
   gdouble y;
 
-  x = (gdouble) photos_image_view_get_x (PHOTOS_IMAGE_VIEW (self->view));
-  /*x = -x + self->crop_x - damage_offset;*/
-
-  y = (gdouble) photos_image_view_get_y (PHOTOS_IMAGE_VIEW (self->view));
-  /*y = -y + self->crop_y - damage_offset;*/
+  x = photos_image_view_get_x (PHOTOS_IMAGE_VIEW (self->view)) + self->crop_x - damage_offset;
+  y = photos_image_view_get_y (PHOTOS_IMAGE_VIEW (self->view)) + self->crop_y - damage_offset;
 
   area.height = (gint) (self->crop_height + 2 * damage_offset + 0.5) + 2;
   area.width = (gint) (self->crop_width + 2 * damage_offset + 0.5) + 2;
@@ -219,7 +214,6 @@ photos_tool_crop_redraw_damaged_area (PhotosToolCrop *self)
   region = cairo_region_create_rectangle (&area);
   gtk_widget_queue_draw_region (self->view, region);
   cairo_region_destroy (region);
-#endif
 }
 
 
@@ -1024,10 +1018,6 @@ photos_tool_crop_deactivate (PhotosTool *tool)
        * so, in practice, the conversion is unnecessary.
        */
 
-      g_message ("Zoom: %f", zoom);
-      g_message ("unscaled: %f, %f, %f, %f", self->crop_x, self->crop_y, self->crop_width, 
self->crop_height);
-      g_message ("caled   : %f, %f, %f, %f", self->crop_x / zoom, self->crop_y / zoom, self->crop_width / 
zoom, self->crop_height / zoom);
-
       parameter_type = g_variant_type_new ("a{sd}");
       g_variant_builder_init (&parameter, parameter_type);
       g_variant_builder_add (&parameter, "{sd}", "x", self->crop_x / zoom);


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