diff options
Diffstat (limited to 'draw/imagedraw.c')
-rw-r--r-- | draw/imagedraw.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/draw/imagedraw.c b/draw/imagedraw.c index d1977cea..5ffe5ed8 100644 --- a/draw/imagedraw.c +++ b/draw/imagedraw.c @@ -1,6 +1,6 @@ #include "fitz.h" -#define LINEAR +#define noLINEAR typedef unsigned char byte; @@ -202,8 +202,8 @@ fz_paintimageimp(fz_pixmap *dst, fz_bbox scissor, fz_pixmap *img, fz_matrix ctm, ctm.b = roundup(ctm.b); ctm.c = roundup(ctm.c); ctm.d = roundup(ctm.d); - ctm.e = floorf(ctm.e) + 0.5f; - ctm.f = floorf(ctm.f) + 0.5f; + ctm.e = floorf(ctm.e);// + 0.5f; + ctm.f = floorf(ctm.f);// + 0.5f; } bbox = fz_roundrect(fz_transformrect(ctm, fz_unitrect)); @@ -223,8 +223,11 @@ fz_paintimageimp(fz_pixmap *dst, fz_bbox scissor, fz_pixmap *img, fz_matrix ctm, fb = inv.b * 65536; fc = inv.c * 65536; fd = inv.d * 65536; - u = (fa * x) + (fc * y) + inv.e * 65536; - v = (fb * x) + (fd * y) + inv.f * 65536; + + /* Calculate initial texture positions. Do a half step to start. */ + /* Also, convert from texture space to sample space (subtract 1/2) */ + u = (fa * x) + (fc * y) + inv.e * 65536 + ((fa+fc)>>1) - 32768; + v = (fb * x) + (fd * y) + inv.f * 65536 + ((fb+fd)>>1) - 32768; dp = dst->samples + ((y - dst->y) * dst->w + (x - dst->x)) * dst->n; n = dst->n; |