mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-02 10:04:31 +00:00
Fonts: Measured and tweaked CalcTextSize() computation to minimize cost in our stress tests.
This commit is contained in:
@@ -3984,9 +3984,7 @@ static ImVec2 InputTextCalcTextSize(ImGuiContext* ctx, const char* text_begin, c
|
||||
if (c == '\r')
|
||||
continue;
|
||||
|
||||
// FIXME-NEWATLAS-V1: Measure perf, inline etc.
|
||||
const float char_width = font->GetCharAdvance((ImWchar)c) * scale;// ((int)c < font->IndexAdvanceX.Size ? font->IndexAdvanceX.Data[c] : font->FallbackAdvanceX)* scale;
|
||||
line_width += char_width;
|
||||
line_width += font->GetCharAdvance((ImWchar)c) * scale;
|
||||
}
|
||||
|
||||
if (text_size.x < line_width)
|
||||
|
||||
Reference in New Issue
Block a user