only apply the effect inside the current selection. This, together with my

* libgimp/gimpaspectpreview.c: (gimp_aspect_preview_draw_buffer) only
  apply the effect inside the current selection. This, together with my
  previous commit fixes bug #132194.
This commit is contained in:
David Odin 2004-10-04 17:40:45 +00:00
parent 97005f180f
commit 2f27c5d453
2 changed files with 53 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2004-10-04 DindinX <dindinx@gimp.org>
* libgimp/gimpaspectpreview.c: (gimp_aspect_preview_draw_buffer) only
apply the effect inside the current selection. This, together with my
previous commit fixes bug #132194.
2004-10-04 DindinX <dindinx@gimp.org>
* plug-ins/common/channel_mixer.c: Ported to GimpAspectPreview. This

View File

@ -150,14 +150,53 @@ gimp_aspect_preview_draw_buffer (GimpPreview *preview,
gint rowstride)
{
GimpDrawable *drawable = GIMP_ASPECT_PREVIEW (preview)->drawable;
gint32 image_id;
if (drawable)
image_id = gimp_drawable_get_image (drawable->drawable_id);
if (gimp_selection_is_empty (image_id))
{
gimp_preview_area_draw (GIMP_PREVIEW_AREA (preview->area),
0, 0,
preview->width, preview->height,
gimp_drawable_type (drawable->drawable_id),
buffer,
rowstride);
}
else
{
guchar *sel;
guchar *src;
gint selection_id;
gint width, height, bpp;
selection_id = gimp_image_get_selection (image_id);
bpp = gimp_drawable_bpp (drawable->drawable_id);
width = preview->width;
height = preview->height;
src = gimp_drawable_get_thumbnail_data (drawable->drawable_id,
&width, &height, &bpp);
bpp = 1;
sel = gimp_drawable_get_thumbnail_data (selection_id,
&width, &height, &bpp);
/* gimp_preview_area_draw (GIMP_PREVIEW_AREA (preview->area),
0, 0,
preview->width, preview->height,
GIMP_GRAY_IMAGE,
sel,
preview->width);*/
gimp_preview_area_mask (GIMP_PREVIEW_AREA (preview->area),
0, 0, preview->width, preview->height,
gimp_drawable_type (drawable->drawable_id),
src, width * drawable->bpp,
buffer, rowstride,
sel, width);
g_free (sel);
g_free (src);
}
}
GtkWidget *