ImDrawList::ChannelsSplit(), ImDrawListSlitter: Fixed an issue with merging draw commands between channels 0 and 1. (#2624) Introduced by cef88f6aae.

This commit is contained in:
omar 2019-06-14 12:06:15 +02:00
parent af3080b81b
commit 2645a2516f
2 changed files with 4 additions and 1 deletions

View File

@ -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 If you were still using the old names, read "API Breaking Changes" section of imgui.cpp to find out
the new names and equivalent. 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) VERSION 1.71 (Released 2019-06-12)

View File

@ -1262,7 +1262,7 @@ void ImDrawListSplitter::Merge(ImDrawList* draw_list)
// Calculate our final buffer sizes. Also fix the incorrect IdxOffset values in each command. // Calculate our final buffer sizes. Also fix the incorrect IdxOffset values in each command.
int new_cmd_buffer_count = 0; int new_cmd_buffer_count = 0;
int new_idx_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; int idx_offset = last_cmd ? last_cmd->IdxOffset + last_cmd->ElemCount : 0;
for (int i = 1; i < _Count; i++) for (int i = 1; i < _Count; i++)
{ {