From 2645a2516f032332b68a66e20b3d2d8adc2490d0 Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 14 Jun 2019 12:06:15 +0200 Subject: [PATCH] ImDrawList::ChannelsSplit(), ImDrawListSlitter: Fixed an issue with merging draw commands between channels 0 and 1. (#2624) Introduced by cef88f6aae52bf0e9e558ea5e30eca95676f439b. --- docs/CHANGELOG.txt | 3 +++ imgui_draw.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 0060217b..cac9990d 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -41,6 +41,9 @@ Breaking Changes: If you were still using the old names, read "API Breaking Changes" section of imgui.cpp to find out the new names and equivalent. +Other Changes: +- ImDrawList::ChannelsSplit(), ImDrawListSlitter: Fixed an issue with merging draw commands between channel 0 and 1. (#2624) + ----------------------------------------------------------------------- VERSION 1.71 (Released 2019-06-12) diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 9f49abaf..53fd4171 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -1262,7 +1262,7 @@ void ImDrawListSplitter::Merge(ImDrawList* draw_list) // Calculate our final buffer sizes. Also fix the incorrect IdxOffset values in each command. int new_cmd_buffer_count = 0; int new_idx_buffer_count = 0; - ImDrawCmd* last_cmd = (_Count > 0 && _Channels[0]._CmdBuffer.Size > 0) ? &_Channels[0]._CmdBuffer.back() : NULL; + ImDrawCmd* last_cmd = (_Count > 0 && draw_list->CmdBuffer.Size > 0) ? &draw_list->CmdBuffer.back() : NULL; int idx_offset = last_cmd ? last_cmd->IdxOffset + last_cmd->ElemCount : 0; for (int i = 1; i < _Count; i++) {