Commit 6a671686 authored by Adrian Johnson's avatar Adrian Johnson Committed by Jeff Muizelaar

Fix regression in cairo output when transforming ctm

The commit:
ec01926e "Avoid setting a singular ctm"
introduced a regression in the output when using a ctm.

The check for an invertable matrix had the side effect of inverting
the matrix. Instead, make a copy of the matrix before testing if it is
invertable.
parent 0b2c3bb2
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment