From 3d4ab5e29e6187d5e97892a7f8a1ce73e809e0cd Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 27 Apr 2017 09:37:39 -0700 Subject: fb: apply fragment coordinates put pixel helper fb_fragment_put_pixel_unchecked() assumed the x,y coordinates of the fragment were always 0. --- src/fb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/fb.h b/src/fb.h index c1cee17..6fdca11 100644 --- a/src/fb.h +++ b/src/fb.h @@ -55,7 +55,7 @@ static inline void fb_fragment_put_pixel_unchecked(fb_fragment_t *fragment, int uint32_t *pixels = fragment->buf; /* FIXME this assumes stride is aligned to 4 */ - pixels[(y * (fragment->width + (fragment->stride >> 2))) + x] = pixel; + pixels[((y - fragment->y) * (fragment->width + (fragment->stride >> 2))) + (x - fragment->x)] = pixel; } -- cgit v1.2.1