From e32569dd5aa008448b10d9be11e5193502f5368b Mon Sep 17 00:00:00 2001 From: omar Date: Sun, 15 Oct 2017 21:06:33 +0200 Subject: [PATCH] ImDrawList: Fixed a bug in ChannelsMerge() leading to an extraneous draw call being created, which unexpectly led to more dramatic condition but to faulty draw command merging code. (#1172, #1368) --- imgui_draw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_draw.cpp b/imgui_draw.cpp index f5923641..9da0ad1c 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -339,7 +339,7 @@ void ImDrawList::ChannelsMerge() if (int sz = ch.CmdBuffer.Size) { memcpy(cmd_write, ch.CmdBuffer.Data, sz * sizeof(ImDrawCmd)); cmd_write += sz; } if (int sz = ch.IdxBuffer.Size) { memcpy(_IdxWritePtr, ch.IdxBuffer.Data, sz * sizeof(ImDrawIdx)); _IdxWritePtr += sz; } } - AddDrawCmd(); + UpdateClipRect(); // We call this instead of AddDrawCmd(), so that empty channels won't produce an extra draw call. _ChannelsCount = 1; }