[poppler] Regression in cairo output
Jeff Muizelaar
jeff at infidigm.net
Wed Mar 12 06:47:34 PDT 2008
Thanks for catching this.
I've committed the fix.
-Jeff
On Wed, Mar 12, 2008 at 09:43:12PM +1030, Adrian Johnson wrote:
> The commit
>
> ec01926e5a9dc16e200060497c43e79a1623698d
> "Avoid setting a singular ctm"
>
> introduced a regression in the output when using a ctm.
>
> The attached patch fixes the problem.
>
>
> >From 172e282ee636818db68d210ed697825355f2ca1a Mon Sep 17 00:00:00 2001
> From: Adrian Johnson <ajohnson at redneon.com>
> Date: Wed, 12 Mar 2008 21:36:26 +1030
> Subject: [PATCH] Fix regression in cairo output when transforming ctm
>
> The check for an invertable matrix had the side effect of inverting
> the matrix.
>
> Make a copy of the matrix before testing if it is invertable.
> ---
> poppler/CairoOutputDev.cc | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
> index d69013a..57c3ac5 100644
> --- a/poppler/CairoOutputDev.cc
> +++ b/poppler/CairoOutputDev.cc
> @@ -209,7 +209,7 @@ void CairoOutputDev::setDefaultCTM(double *ctm) {
> void CairoOutputDev::updateCTM(GfxState *state, double m11, double m12,
> double m21, double m22,
> double m31, double m32) {
> - cairo_matrix_t matrix;
> + cairo_matrix_t matrix, invert_matrix;
> matrix.xx = m11;
> matrix.yx = m12;
> matrix.xy = m21;
> @@ -225,8 +225,9 @@ void CairoOutputDev::updateCTM(GfxState *state, double m11, double m12,
> *
> * Ideally, we could do the cairo_transform
> * and then check if anything went wrong and fix it then
> - * instead of having to invert the matrix twice. */
> - if (cairo_matrix_invert(&matrix)) {
> + * instead of having to invert the matrix. */
> + invert_matrix = matrix;
> + if (cairo_matrix_invert(&invert_matrix)) {
> warning("matrix not invertible\n");
> return;
> }
> --
> 1.5.2.4
>
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
More information about the poppler
mailing list