summaryrefslogtreecommitdiff
path: root/demos/testpixbuf-scale.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-01-06 01:08:10 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-01-06 01:08:10 +0000
commit65de04cdb8c1fcaffc956a776ac38bc7d9d15c1e (patch)
tree268ca1b63217ee99c5a5d8cca3bbfeca2f51e638 /demos/testpixbuf-scale.c
parentbba95de158351a798c3890af3e8807f868dc5083 (diff)
downloadgtk+-65de04cdb8c1fcaffc956a776ac38bc7d9d15c1e.tar.gz
Added scaling functions into gtk-doc framework.
2000-01-05 Owen Taylor <otaylor@redhat.com> * doc/Makefile.am doc/gdk-pixbuf-sections.txt doc/gdk-pixbuf.sgml doc/tmpl/scaling.sgml: Added scaling functions into gtk-doc framework. * gdk-pixbuf/gdk-pixbuf-scale.c: Documentation fixes. * gdk-pixbuf/testpixbuf-scale.c (expose_cb): Simplify a bit. * gdk-pixbuf/pixops/pixops.c (pixops_composite_color): Return immediately if scale_x or scale_y is 0.
Diffstat (limited to 'demos/testpixbuf-scale.c')
-rw-r--r--demos/testpixbuf-scale.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/demos/testpixbuf-scale.c b/demos/testpixbuf-scale.c
index da2e2b0ed6..2efafd6da9 100644
--- a/demos/testpixbuf-scale.c
+++ b/demos/testpixbuf-scale.c
@@ -34,22 +34,13 @@ expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)
dest = gdk_pixbuf_new (ART_PIX_RGB, FALSE, 8, event->area.width, event->area.height);
- if (pixbuf->art_pixbuf->has_alpha || overall_alpha != 255)
- gdk_pixbuf_composite_color (pixbuf, dest,
- 0, 0, event->area.width, event->area.height,
- -event->area.x, -event->area.y,
- (double) widget->allocation.width / pixbuf->art_pixbuf->width,
- (double) widget->allocation.height / pixbuf->art_pixbuf->height,
- filter_level, overall_alpha,
- event->area.x, event->area.y, 16, 0xaaaaaa, 0x555555);
- else
- gdk_pixbuf_scale (pixbuf, dest,
- 0, 0, event->area.width, event->area.height,
- -event->area.x, -event->area.y,
- (double) widget->allocation.width / pixbuf->art_pixbuf->width,
- (double) widget->allocation.height / pixbuf->art_pixbuf->height,
- filter_level);
-
+ gdk_pixbuf_composite_color (pixbuf, dest,
+ 0, 0, event->area.width, event->area.height,
+ -event->area.x, -event->area.y,
+ (double) widget->allocation.width / pixbuf->art_pixbuf->width,
+ (double) widget->allocation.height / pixbuf->art_pixbuf->height,
+ filter_level, overall_alpha,
+ event->area.x, event->area.y, 16, 0xaaaaaa, 0x555555);
gdk_pixbuf_render_to_drawable (dest, widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
0, 0, event->area.x, event->area.y,