gimp r26838 - in trunk: . libgimp



Author: aurisj
Date: Tue Sep  2 17:56:48 2008
New Revision: 26838
URL: http://svn.gnome.org/viewvc/gimp?rev=26838&view=rev

Log:
2008-09-02  Aurimas JuÅka  <aurisj svn gnome org>

	* libgimp/gimpzoompreview.c (gimp_zoom_preview_draw_buffer),
	(gimp_zoom_preview_set_drawable): fixed GimpZoomPreview to handle
	layers with offsets and display intersection of layer and selection
	in the preview. (bug #156905)



Modified:
   trunk/ChangeLog
   trunk/libgimp/gimpzoompreview.c

Modified: trunk/libgimp/gimpzoompreview.c
==============================================================================
--- trunk/libgimp/gimpzoompreview.c	(original)
+++ trunk/libgimp/gimpzoompreview.c	Tue Sep  2 17:56:48 2008
@@ -518,6 +518,8 @@
       gint     src_y;
       gint     src_width;
       gint     src_height;
+      gint     offsx = 0;
+      gint     offsy = 0;
 
       selection_id = gimp_image_get_selection (image_id);
 
@@ -532,8 +534,9 @@
                                                   src_x, src_y,
                                                   src_width, src_height,
                                                   &width, &height, &bpp);
+      gimp_drawable_offsets (drawable->drawable_id, &offsx, &offsy);
       sel = gimp_drawable_get_sub_thumbnail_data (selection_id,
-                                                  src_x, src_y,
+                                                  src_x + offsx, src_y + offsy,
                                                   src_width, src_height,
                                                   &width, &height, &bpp);
 
@@ -632,10 +635,10 @@
 
   priv->drawable = drawable;
 
-  if (_gimp_drawable_preview_get_bounds (drawable, &x1, &y1, &x2, &y2))
+  if (gimp_drawable_mask_intersect (drawable->drawable_id, &x1, &y1, &width, &height))
     {
-      width  = x2 - x1;
-      height = y2 - y1;
+      x2 = x1 + width;
+      y2 = y1 + height;
 
       priv->extents.x = x1;
       priv->extents.y = y1;



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