diff options
author | Matthias Clasen <maclas@gmx.de> | 2004-07-03 02:43:06 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-07-03 02:43:06 +0000 |
commit | 1b7efe47fe0ccd3fe42dd4af0ac6258b33956756 (patch) | |
tree | b4d0896fb3aa8183cf39589a6dbc1d80b49c3a89 /gtk/gtkimage.c | |
parent | dd9253297e0894d4b710957f1a02b64d5a2ac4b8 (diff) | |
download | gtk+-1b7efe47fe0ccd3fe42dd4af0ac6258b33956756.tar.gz |
Properly align mask and pixbuf if a subarea is exposed. (#135423, fix by
Fri Jul 2 22:41:27 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkimage.c (gtk_image_expose): Properly align mask and
pixbuf if a subarea is exposed. (#135423, fix by John Ehresman)
Diffstat (limited to 'gtk/gtkimage.c')
-rw-r--r-- | gtk/gtkimage.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index 24708d53ea..4b45182c82 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -1221,7 +1221,7 @@ gtk_image_expose (GtkWidget *widget, GtkMisc *misc; GdkRectangle area, image_bound; gfloat xalign; - gint x, y; + gint x, y, mask_x, mask_y; GdkBitmap *mask; GdkPixbuf *pixbuf; gboolean needs_state_transform; @@ -1253,6 +1253,8 @@ gtk_image_expose (GtkWidget *widget, y = floor (widget->allocation.y + misc->ypad + ((widget->allocation.height - widget->requisition.height) * misc->yalign) + 0.5); + mask_x = x; + mask_y = y; image_bound.x = x; image_bound.y = y; @@ -1398,7 +1400,7 @@ gtk_image_expose (GtkWidget *widget, if (mask) { gdk_gc_set_clip_mask (widget->style->black_gc, mask); - gdk_gc_set_clip_origin (widget->style->black_gc, x, y); + gdk_gc_set_clip_origin (widget->style->black_gc, mask_x, mask_y); } if (gdk_rectangle_intersect (&image_bound, &area, &image_bound)) |