summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-01-05 15:15:25 +0000
committerRobin Watts <robin.watts@artifex.com>2011-01-05 15:15:25 +0000
commit56eed7c5e97f89368fd838c49f714e5498582460 (patch)
treeb40dec8f3eb854022022f4bd79c598468d5f21fd
parentbf092e4b5ce4810eae3e8c6f54cec19bdf6d2c85 (diff)
downloadmupdf-56eed7c5e97f89368fd838c49f714e5498582460.tar.xz
Correct miscalculation of target image sizes for scaling.
-rw-r--r--draw/imagedraw.c4
-rw-r--r--fitz/dev_draw.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/draw/imagedraw.c b/draw/imagedraw.c
index 99271c54..668bfd22 100644
--- a/draw/imagedraw.c
+++ b/draw/imagedraw.c
@@ -291,9 +291,9 @@ fz_paintimageimp(fz_pixmap *dst, fz_bbox scissor, fz_pixmap *img, fz_matrix ctm,
dolerp = 0;
if (!fz_isrectilinear(ctm))
dolerp = 1;
- if (sqrtf(ctm.a * ctm.a + ctm.c * ctm.c) > img->w)
+ if (sqrtf(ctm.a * ctm.a + ctm.b * ctm.b) > img->w)
dolerp = 1;
- if (sqrtf(ctm.b * ctm.b + ctm.d * ctm.d) > img->h)
+ if (sqrtf(ctm.c * ctm.c + ctm.d * ctm.d) > img->h)
dolerp = 1;
bbox = fz_roundrect(fz_transformrect(ctm, fz_unitrect));
diff --git a/fitz/dev_draw.c b/fitz/dev_draw.c
index e71abe24..02930d8b 100644
--- a/fitz/dev_draw.c
+++ b/fitz/dev_draw.c
@@ -599,8 +599,8 @@ fz_drawfillimage(void *user, fz_pixmap *image, fz_matrix ctm, float alpha)
}
#ifdef SMOOTHSCALE
- dx = sqrtf(ctm.a * ctm.a + ctm.c * ctm.c);
- dy = sqrtf(ctm.b * ctm.b + ctm.d * ctm.d);
+ dx = sqrtf(ctm.a * ctm.a + ctm.b * ctm.b);
+ dy = sqrtf(ctm.c * ctm.c + ctm.d * ctm.d);
if (dx < image->w && dy < image->h)
{
scaled = fz_smoothtransformpixmap(image, &ctm, dev->dest->x, dev->dest->y, dx, dy);