From 1aed48f1b0e15a3d512777f1abe2b232655158fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aurimas=20Ju=C5=A1ka?= Date: Tue, 2 Sep 2008 17:56:48 +0000 Subject: [PATCH] fixed GimpZoomPreview to handle layers with offsets and display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-09-02 Aurimas Juška * 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) svn path=/trunk/; revision=26838 --- ChangeLog | 7 +++++++ libgimp/gimpzoompreview.c | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d3747f274..991afaaf74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-09-02 Aurimas Juška + + * 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) + 2008-09-02 Michael Natterer * app/display/gimpstatusbar.c: use gtk_widget_get_style() instead diff --git a/libgimp/gimpzoompreview.c b/libgimp/gimpzoompreview.c index ed7ca4999f..8ac050697a 100644 --- a/libgimp/gimpzoompreview.c +++ b/libgimp/gimpzoompreview.c @@ -518,6 +518,8 @@ gimp_zoom_preview_draw_buffer (GimpPreview *preview, 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 @@ gimp_zoom_preview_draw_buffer (GimpPreview *preview, 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 @@ gimp_zoom_preview_set_drawable (GimpZoomPreview *preview, 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;