| 3553 | } |
| 3554 | |
| 3555 | static 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 | |
| 3569 | static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining, ImVec2* out_offset, bool stop_on_new_line) |
| 3570 | { |