mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibPDF: Scale delta_x by horizontal_scaling in Renderer::show_text()
While PDFFont::draw_string() already returns a position scaled by horizontal_scaling, the division by text_rendering_matrix.x_scale() (which also contains the scaling factor) undid it. Reapply it. Fixes the horizontal layout of the line "should be the same on all lines: super" in Tests/LibPDF/text.pdf.
This commit is contained in:
parent
470d1d8dcf
commit
abda5e66f6
Notes:
sideshowbarker
2024-07-17 20:33:50 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/abda5e66f6 Pull-request: https://github.com/SerenityOS/serenity/pull/22819 Reviewed-by: https://github.com/AtkinsSJ
1 changed files with 1 additions and 1 deletions
|
@ -1019,7 +1019,7 @@ PDFErrorOr<void> Renderer::show_text(ByteString const& string)
|
|||
// Update text matrix
|
||||
auto delta_x = end_position.x() - start_position.x();
|
||||
m_text_rendering_matrix_is_dirty = true;
|
||||
m_text_matrix.translate(delta_x / text_rendering_matrix.x_scale(), 0.0f);
|
||||
m_text_matrix.translate(delta_x / text_rendering_matrix.x_scale() * text_state().horizontal_scaling, 0.0f);
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue