From 9f04e2425664d6600f430a0af89f8d9d50767998 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 22 Jul 2016 22:00:48 +0300 Subject: [PATCH] Use cap height instead of ascent for midline alignment --- source/text.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/text.cpp b/source/text.cpp index e3a85400..03421f54 100644 --- a/source/text.cpp +++ b/source/text.cpp @@ -61,7 +61,7 @@ void Text::set_alignment(HorizontalAlign ha, VerticalAlign va) { case DESCENT: v = -font.get_descent(); break; case BASELINE: v = 0.0f; break; - case MIDLINE: v = font.get_ascent()/2; break; // XXX Midline should be cap height / 2 + case MIDLINE: v = font.get_cap_height()/2; break; case ASCENT: v = font.get_ascent(); break; default: throw invalid_argument("Text::set_alignment"); } -- 2.43.0