mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:47:35 +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
1 changed files with 1 additions and 1 deletions
|
@ -1019,7 +1019,7 @@ PDFErrorOr<void> Renderer::show_text(ByteString const& string)
|
||||||
// Update text matrix
|
// Update text matrix
|
||||||
auto delta_x = end_position.x() - start_position.x();
|
auto delta_x = end_position.x() - start_position.x();
|
||||||
m_text_rendering_matrix_is_dirty = true;
|
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 {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue