MCPcopy Create free account
hub / github.com/Raais/ImStudio / InputTextCalcTextLenAndLineCount

Function InputTextCalcTextLenAndLineCount

src/third-party/imgui/imgui_widgets.cpp:3555–3567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3553}
3554
3555static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end)
3556{
3557 int line_count = 0;
3558 const char* s = text_begin;
3559 while (char c = *s++) // We are only matching for \n so we can ignore UTF-8 decoding
3560 if (c == '\n')
3561 line_count++;
3562 s--;
3563 if (s[0] != '\n' && s[0] != '\r')
3564 line_count++;
3565 *out_text_end = s;
3566 return line_count;
3567}
3568
3569static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining, ImVec2* out_offset, bool stop_on_new_line)
3570{

Callers 1

InputTextExMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected