poppler/SplashOutputDev.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 07ce486444556f4d3b103e41219913f087d20ed2 Author: Albert Astals Cid <[email protected]> Date: Sat Sep 25 12:47:37 2021 +0200 Splash: Fix pattern whose values are not 0 but close enough They were causing the resulting calculation to be bad The new code looks "weird" as it basically just talkes the max value out of 2 values in the matrix, but i've played with different values and it works fine and the test suite can't find any rendering regression either Issue #1138 diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc index 10e40a0c..357a3156 100644 --- a/poppler/SplashOutputDev.cc +++ b/poppler/SplashOutputDev.cc @@ -4248,10 +4248,10 @@ bool SplashOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat result_height = (int)ceil(fabs(ky * height * (y1 - y0))); kx = state->getHDPI() / 72.0; ky = state->getVDPI() / 72.0; - m1.m[0] = (ptm[0] == 0) ? fabs(ptm[2]) * kx : fabs(ptm[0]) * kx; + m1.m[0] = std::max(fabs(ptm[0]), fabs(ptm[2])) * kx; m1.m[1] = 0; m1.m[2] = 0; - m1.m[3] = (ptm[3] == 0) ? fabs(ptm[1]) * ky : fabs(ptm[3]) * ky; + m1.m[3] = std::max(fabs(ptm[1]), fabs(ptm[3])) * kx; m1.m[4] = 0; m1.m[5] = 0; m1.transform(width, height, &kx, &ky);
