mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 03:58:47 +02:00
ImFont: Renamed (supposedly internal) fields (e.g. XAdvance to AdvanceX). Custom text renderers might be affected if they didn't use the GetCharAdvance() helper function.
This commit is contained in:
@ -3065,7 +3065,7 @@ ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_tex
|
||||
return ImVec2(0.0f, font_size);
|
||||
ImVec2 text_size = font->CalcTextSizeA(font_size, FLT_MAX, wrap_width, text, text_display_end, NULL);
|
||||
|
||||
// Cancel out character spacing for the last character of a line (it is baked into glyph->XAdvance field)
|
||||
// Cancel out character spacing for the last character of a line (it is baked into glyph->AdvanceX field)
|
||||
const float font_scale = font_size / font->FontSize;
|
||||
const float character_spacing_x = 1.0f * font_scale;
|
||||
if (text_size.x > 0.0f)
|
||||
@ -7856,8 +7856,8 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
|
||||
password_font->Descent = g.Font->Descent;
|
||||
password_font->ContainerAtlas = g.Font->ContainerAtlas;
|
||||
password_font->FallbackGlyph = glyph;
|
||||
password_font->FallbackXAdvance = glyph->XAdvance;
|
||||
IM_ASSERT(password_font->Glyphs.empty() && password_font->IndexXAdvance.empty() && password_font->IndexLookup.empty());
|
||||
password_font->FallbackAdvanceX = glyph->AdvanceX;
|
||||
IM_ASSERT(password_font->Glyphs.empty() && password_font->IndexAdvanceX.empty() && password_font->IndexLookup.empty());
|
||||
PushFont(password_font);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user