summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibPDF
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2021-05-25 08:29:21 -0700
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-06-12 22:45:01 +0430
commitcafd7c11b4270e8a25534f48a3a2231fc742e80e (patch)
tree21b75233b702b680e65fb140e551853b4496724a /Userland/Libraries/LibPDF
parente7b70a1435fc391eea248cac0603eabccec2f8a1 (diff)
downloadserenity-cafd7c11b4270e8a25534f48a3a2231fc742e80e.zip
LibPDF: Account for inverted y axis when rendering text
Diffstat (limited to 'Userland/Libraries/LibPDF')
-rw-r--r--Userland/Libraries/LibPDF/Renderer.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Libraries/LibPDF/Renderer.cpp b/Userland/Libraries/LibPDF/Renderer.cpp
index a66ce740f9..a0de5c37f9 100644
--- a/Userland/Libraries/LibPDF/Renderer.cpp
+++ b/Userland/Libraries/LibPDF/Renderer.cpp
@@ -540,6 +540,7 @@ void Renderer::show_text(const String& string, int shift)
auto text_position = text_rendering_matrix.map(Gfx::FloatPoint { 0.0f, 0.0f });
text_position.set_y(static_cast<float>(m_bitmap->height()) - text_position.y());
+ text_position.set_y(text_position.y() - static_cast<float>(font->baseline()));
// FIXME: For some reason, the space character in LiberationSerif is drawn as an exclamation point
if (code_point != 0x20)