MCPcopy Create free account
hub / github.com/crossuo/crossuo / FixMaxWidthA

Method FixMaxWidthA

src/TextEngine/EntryText.cpp:381–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379}
380
381void CEntryText::FixMaxWidthA(uint8_t font)
382{
383 if (MaxWidth <= 0)
384 {
385 return;
386 }
387
388 int width = g_FontManager.GetWidthA(font, GetTextA());
389 size_t len = GetTextA().length();
390 while (MaxWidth < width && len > 0)
391 {
392 Remove((m_Position > 0), nullptr);
393 len--;
394 width = g_FontManager.GetWidthA(font, GetTextA());
395 }
396}
397
398void CEntryText::FixMaxWidthW(uint8_t font)
399{

Callers

nothing calls this directly

Calls 3

RemoveFunction · 0.85
GetWidthAMethod · 0.80
lengthMethod · 0.80

Tested by

no test coverage detected