mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-23 20:06:52 +00:00
Tables: Angled headers: fixed multi-line label display when angle is flipped. (#6917)
This commit is contained in:
14
imgui.cpp
14
imgui.cpp
@@ -2334,6 +2334,20 @@ const char* ImTextFindPreviousUtf8Codepoint(const char* in_text_start, const cha
|
||||
return in_text_start;
|
||||
}
|
||||
|
||||
int ImTextCountLines(const char* in_text, const char* in_text_end)
|
||||
{
|
||||
if (in_text_end == NULL)
|
||||
in_text_end = in_text + strlen(in_text); // FIXME-OPT: Not optimal approach, discourage use for now.
|
||||
int count = 0;
|
||||
while (in_text < in_text_end)
|
||||
{
|
||||
const char* line_end = (const char*)memchr(in_text, '\n', in_text_end - in_text);
|
||||
in_text = line_end ? line_end + 1 : in_text_end;
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
IM_MSVC_RUNTIME_CHECKS_RESTORE
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user