summaryrefslogtreecommitdiff
path: root/demos/testpixbuf-scale.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-08-30 14:56:28 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-08-30 14:56:28 +0900
commit54d44a9bd04cfbed8426614fc69c027a46f41a14 (patch)
tree34bdf65a6e8d5d6d4016154345d1d803ba0da379 /demos/testpixbuf-scale.c
parentb3b22c31b997fb85b3319b392a1a69407703184c (diff)
parent67194ed77b153eb5a7eb6c596f3c20e274b7787a (diff)
downloadgtk+-native-layout.tar.gz
Merge branch 'master' into native-layoutnative-layout
Conflicts: gtk/gtkplug.c gtk/gtkscrolledwindow.c
Diffstat (limited to 'demos/testpixbuf-scale.c')
-rw-r--r--demos/testpixbuf-scale.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/demos/testpixbuf-scale.c b/demos/testpixbuf-scale.c
index 6d335e1cc0..50244e4f72 100644
--- a/demos/testpixbuf-scale.c
+++ b/demos/testpixbuf-scale.c
@@ -34,18 +34,21 @@ overall_changed_cb (GtkAdjustment *adjustment, gpointer data)
gboolean
expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
+ GtkAllocation allocation;
GdkPixbuf *dest;
cairo_t *cr;
- gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
-
+ gdk_window_set_back_pixmap (gtk_widget_get_window (widget),
+ NULL, FALSE);
+
dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, event->area.width, event->area.height);
+ gtk_widget_get_allocation (widget, &allocation);
gdk_pixbuf_composite_color (pixbuf, dest,
0, 0, event->area.width, event->area.height,
-event->area.x, -event->area.y,
- (double) widget->allocation.width / gdk_pixbuf_get_width (pixbuf),
- (double) widget->allocation.height / gdk_pixbuf_get_height (pixbuf),
+ (double) allocation.width / gdk_pixbuf_get_width (pixbuf),
+ (double) allocation.height / gdk_pixbuf_get_height (pixbuf),
interp_type, overall_alpha,
event->area.x, event->area.y, 16, 0xaaaaaa, 0x555555);