mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-19 03:17:08 +00:00
DrawList: Allow AddText() to accept null ranges. (#3615, 7391)
This commit is contained in:
@@ -1613,10 +1613,11 @@ void ImDrawList::AddText(const ImFont* font, float font_size, const ImVec2& pos,
|
||||
if ((col & IM_COL32_A_MASK) == 0)
|
||||
return;
|
||||
|
||||
// Accept null ranges
|
||||
if (text_begin == text_end || text_begin[0] == 0)
|
||||
return;
|
||||
if (text_end == NULL)
|
||||
text_end = text_begin + strlen(text_begin);
|
||||
if (text_begin == text_end)
|
||||
return;
|
||||
|
||||
// Pull default font/size from the shared ImDrawListSharedData instance
|
||||
if (font == NULL)
|
||||
|
||||
Reference in New Issue
Block a user