diff --git a/imgui.cpp b/imgui.cpp index 75a35b4..55931b6 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6625,10 +6625,10 @@ if (!text_end) text_end = text_begin + strlen(text_begin); - const float line_height = (float)Info->FontSize; const float scale = size / (float)Info->FontSize; + const float line_height = (float)Info->FontSize * scale; const float tex_scale_x = 1.0f / (float)Common->ScaleW; - const float tex_scale_y = 1.0f / (float)(Common->ScaleH); + const float tex_scale_y = 1.0f / (float)Common->ScaleH; const float outline = (float)Info->Outline; // Align to be pixel perfect @@ -6658,7 +6658,7 @@ if (s >= word_wrap_eol) { x = pos.x; - y += line_height * scale; + y += line_height; word_wrap_eol = NULL; // Wrapping skips upcoming blanks @@ -6679,7 +6679,7 @@ if (c == '\n') { x = pos.x; - y += line_height * scale; + y += line_height; continue; } diff --git a/imgui.cpp b/imgui.cpp index 75a35b4..55931b6 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6625,10 +6625,10 @@ if (!text_end) text_end = text_begin + strlen(text_begin); - const float line_height = (float)Info->FontSize; const float scale = size / (float)Info->FontSize; + const float line_height = (float)Info->FontSize * scale; const float tex_scale_x = 1.0f / (float)Common->ScaleW; - const float tex_scale_y = 1.0f / (float)(Common->ScaleH); + const float tex_scale_y = 1.0f / (float)Common->ScaleH; const float outline = (float)Info->Outline; // Align to be pixel perfect @@ -6658,7 +6658,7 @@ if (s >= word_wrap_eol) { x = pos.x; - y += line_height * scale; + y += line_height; word_wrap_eol = NULL; // Wrapping skips upcoming blanks @@ -6679,7 +6679,7 @@ if (c == '\n') { x = pos.x; - y += line_height * scale; + y += line_height; continue; } diff --git a/imgui.h b/imgui.h index ddf94b1..fdd1797 100644 --- a/imgui.h +++ b/imgui.h @@ -745,7 +745,7 @@ // Settings float Scale; // = 1.0f // Base font scale, multiplied by the per-window font scale which you can adjust with SetFontScale() - ImVec2 DisplayOffset; // = (0.0f,0.0f // Offset font rendering by xx pixels + ImVec2 DisplayOffset; // = (0.0f,0.0f) // Offset font rendering by xx pixels ImVec2 TexUvForWhite; // = (0.0f,0.0f) // Font texture must have a white pixel at this UV coordinate. Adjust if you are using custom texture. ImWchar FallbackChar; // = '?' // Replacement glyph is one isn't found.