diff options
author | Matthew Olsson <matthewcolsson@gmail.com> | 2022-03-06 14:27:04 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-07 10:53:57 +0100 |
commit | 4d509ff365c97a17455f4e1da6f792e45f052988 (patch) | |
tree | de4ac6ad9d2e53a07793b5dada2d23db8cc75d0b /Userland | |
parent | 6f1cfcf217bf19a4c53873dc7c0858d20e8fec28 (diff) | |
download | serenity-4d509ff365c97a17455f4e1da6f792e45f052988.zip |
LibPDF: Fix "incorrect" matrix multiplication in Renderer
Incorrect is in quotes because the spec (both 1.7 and 2.0) specify this
multiplication as it was originally! However, flipping the order of
operations here makes the text in all of my test cases render in the
correct position.
The CTM is a transformation matrix between the text coordinate system
and the device coordinate system. However, being on the right-side of
the multiplication means that the CTM scale parameters don't have any
influence on the translation component of the left-side matrix. This
oddity is what originally led to me just trying this change to see if
it worked.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibPDF/Renderer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibPDF/Renderer.cpp b/Userland/Libraries/LibPDF/Renderer.cpp index c25f17fea3..a6ffd0ffbe 100644 --- a/Userland/Libraries/LibPDF/Renderer.cpp +++ b/Userland/Libraries/LibPDF/Renderer.cpp @@ -694,8 +694,8 @@ Gfx::AffineTransform const& Renderer::calculate_text_rendering_matrix() 1.0f, 0.0f, text_state().rise); - m_text_rendering_matrix.multiply(m_text_matrix); m_text_rendering_matrix.multiply(state().ctm); + m_text_rendering_matrix.multiply(m_text_matrix); m_text_rendering_matrix_is_dirty = false; } return m_text_rendering_matrix; |