mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibPDF: Resize fonts when the text and line matrices change
This commit is contained in:
parent
9a0e1dde42
commit
5f8fd47214
Notes:
sideshowbarker
2024-07-17 04:49:48 +09:00
Author: https://github.com/mattco98
Commit: 5f8fd47214
Pull-request: https://github.com/SerenityOS/serenity/pull/20084
Reviewed-by: https://github.com/nico ✅
8 changed files with 26 additions and 0 deletions
|
@ -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 {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue