Quellcode durchsuchen

LibPDF: Mark text rendering matrix dirty for Td operator

0000342.pdf page 5 contains this snippet:

```
/T1_1 10.976 Tf
0 -31.643 TD
(This)Tj

1 0 0 1 54 745.563 Tm
22.181 -31.643 Td
[(vehicle)-270.926(uses)...
```

The `Tm` marked the text rendering matrix as dirty at the start,
but it then calls calculate_text_rendering_matrix() almost in the
next line, which recalculates the text rendering matrix and caches
the new matrix. The `Td` used to not mark it as dirty, and we'd
draw "vehicle" with an incorrect matrix.
Nico Weber vor 1 Jahr
Ursprung
Commit
f23f5dcd62
1 geänderte Dateien mit 1 neuen und 0 gelöschten Zeilen
  1. 1 0
      Userland/Libraries/LibPDF/Renderer.cpp

+ 1 - 0
Userland/Libraries/LibPDF/Renderer.cpp

@@ -503,6 +503,7 @@ RENDERER_HANDLER(text_next_line_offset)
     Gfx::AffineTransform transform(1.0f, 0.0f, 0.0f, 1.0f, args[0].to_float(), args[1].to_float());
     m_text_line_matrix.multiply(transform);
     m_text_matrix = m_text_line_matrix;
+    m_text_rendering_matrix_is_dirty = true;
     return {};
 }