From bddd4ca943cfb966f965d71cbcae9c71dc21ce41 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Sat, 19 Feb 2000 22:05:48 +0000 Subject: Fix error in scale factors for non-alpha case. 2000-02-19 Owen Taylor * gdk-pixbuf/pixops/pixops.c (scale_pixel): Fix error in scale factors for non-alpha case. --- gdk-pixbuf/pixops/pixops.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gdk-pixbuf/pixops') diff --git a/gdk-pixbuf/pixops/pixops.c b/gdk-pixbuf/pixops/pixops.c index d6646cfcd..80246505d 100644 --- a/gdk-pixbuf/pixops/pixops.c +++ b/gdk-pixbuf/pixops/pixops.c @@ -672,9 +672,9 @@ scale_pixel (art_u8 *dest, int dest_x, int dest_channels, int dest_has_alpha, } else { - dest[0] = r >> 16; - dest[1] = g >> 16; - dest[2] = b >> 16; + dest[0] = (r + 0xffffff) >> 24; + dest[1] = (g + 0xffffff) >> 24; + dest[2] = (b + 0xffffff) >> 24; if (dest_has_alpha) dest[3] = 0xff; @@ -755,9 +755,9 @@ scale_line (int *weights, int n_x, int n_y, } } - dest[0] = r >> 16; - dest[1] = g >> 16; - dest[2] = b >> 16; + dest[0] = (r + 0xffff) >> 16; + dest[1] = (g + 0xffff) >> 16; + dest[2] = (b + 0xffff) >> 16; if (dest_has_alpha) dest[3] = 0xff; -- cgit v1.2.1