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.
This commit is contained in:
Nico Weber 2024-01-14 21:17:12 -05:00 committed by Sam Atkins
parent 7c2713c14f
commit f23f5dcd62
Notes: sideshowbarker 2024-07-16 19:17:47 +09:00

View File

@ -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 {};
}