MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / getTextThatFits

Function getTextThatFits

source/ui/controls/listViewItem.cpp:28–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28const char* getTextThatFits(const char* p, float width) {
29 const char* result = p + 1;
30 while (ImGui::CalcTextSize(p, result, false, 9999.0f).x<width) {
31 result++;
32 }
33 result--;
34 return result;
35}
36
37void drawListViewItem(const ListViewItem& item) {
38 float width = ImGui::GetColumnWidth()-GlobalSettings::scaleFloatUI(4.0f);

Callers 1

drawListViewItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected