[poppler] poppler/Gfx.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed May 15 09:39:24 UTC 2019


 poppler/Gfx.cc |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 0477707248bb62404961a08e75ecaf106529e7e1
Author: Oliver Sander <oliver.sander at tu-dresden.de>
Date:   Thu Apr 25 21:33:30 2019 +0200

    Call updateCTM with the identity matrix instead of all zeros
    
    The method Gfx::doShowText calls out->updateCTM once with the all-zero
    matrix.  This was apparently implemented with the Splash output device
    in mind: SplashOutputDev::updateCTM ignores its parameters, and
    therefore calling it with a zero matrix is okay.  For other output
    devices calling updateCTM with a zero matrix multiplies the CTM
    with zero, which breaks further rendering.  See
    
      https://gitlab.freedesktop.org/poppler/poppler/issues/206
    
    for an example.
    
    This patch changes the argument to updateCTM in doShowText
    from the zero matrix to an identity matrix.  That way, the CTM
    is unchanged no matter how the output device implements its
    updateCTM method.

diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 5fba4c72..a9b93b61 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -4007,7 +4007,10 @@ void Gfx::doShowText(const GooString *s) {
       curX += tdx;
       curY += tdy;
       state->moveTo(curX, curY);
-      out->updateCTM(state, 0, 0, 0, 0, 0, 0);
+      // Call updateCTM with the identity transformation.  That way, the CTM is unchanged,
+      // but any side effect that the method may have is triggered.  This is the case,
+      // in particular, for the Splash backend.
+      out->updateCTM(state, 1, 0, 0, 1, 0, 0);
       p += n;
       len -= n;
     }


More information about the poppler mailing list