Commit 1aed48f1 authored by Aurimas Juška's avatar Aurimas Juška Committed by Aurimas Juška

fixed GimpZoomPreview to handle layers with offsets and display

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)


svn path=/trunk/; revision=26838
parent 9d18f2aa
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)
2008-09-02 Michael Natterer <mitch@gimp.org> 2008-09-02 Michael Natterer <mitch@gimp.org>
* app/display/gimpstatusbar.c: use gtk_widget_get_style() instead * app/display/gimpstatusbar.c: use gtk_widget_get_style() instead
......
...@@ -518,6 +518,8 @@ gimp_zoom_preview_draw_buffer (GimpPreview *preview, ...@@ -518,6 +518,8 @@ gimp_zoom_preview_draw_buffer (GimpPreview *preview,
gint src_y; gint src_y;
gint src_width; gint src_width;
gint src_height; gint src_height;
gint offsx = 0;
gint offsy = 0;
selection_id = gimp_image_get_selection (image_id); selection_id = gimp_image_get_selection (image_id);
...@@ -532,8 +534,9 @@ gimp_zoom_preview_draw_buffer (GimpPreview *preview, ...@@ -532,8 +534,9 @@ gimp_zoom_preview_draw_buffer (GimpPreview *preview,
src_x, src_y, src_x, src_y,
src_width, src_height, src_width, src_height,
&width, &height, &bpp); &width, &height, &bpp);
gimp_drawable_offsets (drawable->drawable_id, &offsx, &offsy);
sel = gimp_drawable_get_sub_thumbnail_data (selection_id, sel = gimp_drawable_get_sub_thumbnail_data (selection_id,
src_x, src_y, src_x + offsx, src_y + offsy,
src_width, src_height, src_width, src_height,
&width, &height, &bpp); &width, &height, &bpp);
...@@ -632,10 +635,10 @@ gimp_zoom_preview_set_drawable (GimpZoomPreview *preview, ...@@ -632,10 +635,10 @@ gimp_zoom_preview_set_drawable (GimpZoomPreview *preview,
priv->drawable = drawable; 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; x2 = x1 + width;
height = y2 - y1; y2 = y1 + height;
priv->extents.x = x1; priv->extents.x = x1;
priv->extents.y = y1; priv->extents.y = y1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment