From fa9e2e6061d565054b3c4e91e468551b72274f44 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 8 Jul 2010 16:43:41 +0000 Subject: Slight optimisation for scaled image plotting. svn path=/trunk/libnsfb/; revision=10612 --- src/plot/8bpp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plot/8bpp.c') diff --git a/src/plot/8bpp.c b/src/plot/8bpp.c index 00402f3..4da9df2 100644 --- a/src/plot/8bpp.c +++ b/src/plot/8bpp.c @@ -349,7 +349,7 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc, /* get veritcal (y) and horizontal (x) scale factors; both integer * part and remainder */ dx = bmp_width / width; - dy = bmp_height / height; + dy = (bmp_height / height) * bmp_stride; dxr = bmp_width % width; dyr = bmp_height % height; rx = ry = 0; /* initialise remainder counters */ @@ -393,7 +393,7 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc, } } /* handle vertical interpolation */ - yoff += bmp_stride * dy; + yoff += dy; ry += dyr; if (ry >= height) { yoff += bmp_stride; @@ -422,7 +422,7 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc, } } /* handle vertical interpolation */ - yoff += bmp_stride * dy; + yoff += dy; ry += dyr; if (ry >= height) { yoff += bmp_stride; -- cgit v1.2.3