LibPDF: Resize fonts when the text and line matrices change

This commit is contained in:
Matthew Olsson 2023-07-18 18:35:53 -07:00 committed by Sam Atkins
commit 5f8fd47214
Notes: sideshowbarker 2024-07-17 04:49:48 +09:00
8 changed files with 26 additions and 0 deletions

View file

@ -458,6 +458,13 @@ RENDERER_HANDLER(text_set_matrix_and_line_matrix)
m_text_line_matrix = new_transform;
m_text_matrix = new_transform;
m_text_rendering_matrix_is_dirty = true;
// Settings the text/line matrix retroactively affects fonts
if (text_state().font) {
auto new_text_rendering_matrix = calculate_text_rendering_matrix();
text_state().font->set_font_size(text_state().font_size * new_text_rendering_matrix.x_scale());
}
return {};
}