瀏覽代碼

Fixed trailing \n reporting extra text height

ocornut 11 年之前
父節點
當前提交
9169b2911c
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      imgui.cpp

+ 1 - 1
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);