mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Fonts: Measured and tweaked CalcTextSize() computation to minimize cost in our stress tests.
This commit is contained in:
parent
076a1ab85c
commit
a6c7801926
2 changed files with 27 additions and 12 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue