From 7a8eb5bdc971d3f1b82ae8683a9df9b4c1437a78 Mon Sep 17 00:00:00 2001 From: Dominik Tugend Date: Sun, 15 Oct 2017 19:27:53 +0200 Subject: [PATCH] Rendering issue fix Fixes ocornut/imgui#1172 --- imgui_draw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 73647689..f5923641 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -222,7 +222,7 @@ void ImDrawList::UpdateTextureID() // Try to merge with previous command if it matches, else use current command ImDrawCmd* prev_cmd = CmdBuffer.Size > 1 ? curr_cmd - 1 : NULL; - if (prev_cmd && prev_cmd->TextureId == curr_texture_id && memcmp(&prev_cmd->ClipRect, &GetCurrentClipRect(), sizeof(ImVec4)) == 0 && prev_cmd->UserCallback == NULL) + if (curr_cmd->ElemCount == 0 && prev_cmd && prev_cmd->TextureId == curr_texture_id && memcmp(&prev_cmd->ClipRect, &GetCurrentClipRect(), sizeof(ImVec4)) == 0 && prev_cmd->UserCallback == NULL) CmdBuffer.pop_back(); else curr_cmd->TextureId = curr_texture_id;