diff options
Diffstat (limited to 'draw/draw_affine.c')
-rw-r--r-- | draw/draw_affine.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/draw/draw_affine.c b/draw/draw_affine.c index c0fe1fea..5d4ca5b5 100644 --- a/draw/draw_affine.c +++ b/draw/draw_affine.c @@ -608,13 +608,15 @@ fz_paint_image_imp(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz void (*paintfn)(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, int alpha, byte *color, byte *hp); fz_matrix local_ctm = *ctm; fz_rect rect; + int is_rectilinear; /* grid fit the image */ fz_gridfit_matrix(&local_ctm); /* turn on interpolation for upscaled and non-rectilinear transforms */ dolerp = 0; - if (!fz_is_rectilinear(&local_ctm)) + is_rectilinear = fz_is_rectilinear(&local_ctm); + if (!is_rectilinear) dolerp = 1; if (sqrtf(local_ctm.a * local_ctm.a + local_ctm.b * local_ctm.b) > img->w) dolerp = 1; @@ -673,11 +675,14 @@ fz_paint_image_imp(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz * that we have found. */ if (dolerp) { u -= 32768; - if (u < 0) - u = 0; v -= 32768; - if (v < 0) - v = 0; + if (is_rectilinear) + { + if (u < 0) + u = 0; + if (v < 0) + v = 0; + } } dp = dst->samples + (unsigned int)(((y - dst->y) * dst->w + (x - dst->x)) * dst->n); |