mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 03:58:47 +02:00
Internals: Added ImTextFindPreviousUtf8Codepoint() helper + comments.
This commit is contained in:
12
imgui.cpp
12
imgui.cpp
@ -2265,6 +2265,18 @@ int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_e
|
||||
}
|
||||
return bytes_count;
|
||||
}
|
||||
|
||||
const char* ImTextFindPreviousUtf8Codepoint(const char* in_text_start, const char* in_text_curr)
|
||||
{
|
||||
while (in_text_curr > in_text_start)
|
||||
{
|
||||
in_text_curr--;
|
||||
if ((*in_text_curr & 0xC0) != 0x80)
|
||||
return in_text_curr;
|
||||
}
|
||||
return in_text_start;
|
||||
}
|
||||
|
||||
IM_MSVC_RUNTIME_CHECKS_RESTORE
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user