From f12fbc1b3267227fa677d81949a6ca4b8e5015de Mon Sep 17 00:00:00 2001 From: Mark Crichton Date: Sat, 17 Jul 1999 03:00:10 +0000 Subject: [PATCH] Fixed up the scaling routine. Fixed up the scaling routine. --- gdk-pixbuf/gdk-pixbuf.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c index 2fbd7213aa..79eb80430b 100644 --- a/gdk-pixbuf/gdk-pixbuf.c +++ b/gdk-pixbuf/gdk-pixbuf.c @@ -56,11 +56,10 @@ gdk_pixbuf_scale (GdkPixBuf *pixbuf, gint w, gint h) alphagamma = NULL; - affine[0] = affine[3] = 1; - affine[4] = affine[5] = 0; + affine[1] = affine[2] = affine[4] = affine[5] = 0; - affine[1] = w / (pixbuf->art_pixbuf->width); - affine[2] = h / (pixbuf->art_pixbuf->height); + affine[0] = w / (pixbuf->art_pixbuf->width); + affine[3] = h / (pixbuf->art_pixbuf->height); spb = g_new (GdkPixBuf, 1); @@ -79,7 +78,7 @@ gdk_pixbuf_scale (GdkPixBuf *pixbuf, gint w, gint h) spb->art_pixbuf = art_pixbuf_new_rgba(pixels, w, h, (w * 4)); #endif } else { - art_alloc (h * w * 3); + pixels = art_alloc (h * w * 3); art_rgb_affine( pixels, 0, 0, w, h, (w * 3), pixbuf->art_pixbuf->pixels, pixbuf->art_pixbuf->width, @@ -87,5 +86,7 @@ gdk_pixbuf_scale (GdkPixBuf *pixbuf, gint w, gint h) pixbuf->art_pixbuf->rowstride, affine, ART_FILTER_NEAREST, alphagamma); spb->art_pixbuf = art_pixbuf_new_rgb(pixels, w, h, (w * 3)); + spb->ref_count = 0; + spb->unref_func = NULL; } }