From 59d22f133aad44d141405a1bb988b47dbcb4405f Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 20 Mar 2009 23:25:19 +1030 Subject: [PATCH] Fix cairo luminosity smask when cairo ctm != identity --- poppler/CairoOutputDev.cc | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index fd93e05..91e1d04 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -949,8 +949,22 @@ void CairoOutputDev::setSoftMask(GfxState * state, double * bbox, GBool alpha, * So we paint the group to an image surface convert it to a luminocity map * and then use that as the mask. */ - double x1, y1, x2, y2; + double x1, y1, x2, y2, tmp; cairo_clip_extents(cairo, &x1, &y1, &x2, &y2); + cairo_user_to_device(cairo, &x1, &y1); + cairo_user_to_device(cairo, &x2, &y2); + if (x1 > x2) { + tmp = x1; + x1 = x2; + x2 = tmp; + } + + if (y1 > y2) { + tmp = y1; + y1 = y2; + y2 = tmp; + } + int width = (int)(ceil(x2) - floor(x1)); int height = (int)(ceil(y2) - floor(y1)); -- 1.5.6.3