From 9169b2911c28ea2080c56885a2b0f8aa6e8f1f9f Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 14 Aug 2014 17:01:42 +0100 Subject: [PATCH] Fixed trailing \n reporting extra text height --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 0e0dc348..d24436c3 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5079,7 +5079,7 @@ ImVec2 ImBitmapFont::CalcTextSize(float size, float max_width, const char* text_ text_size.y += line_height; line_width = 0; } - if (const FntGlyph* glyph = FindGlyph((unsigned short)c)) + else if (const FntGlyph* glyph = FindGlyph((unsigned short)c)) { const float char_width = (glyph->XAdvance + Info->SpacingHoriz) * scale; //const float char_extend = (glyph->XOffset + glyph->Width * scale);