Skip to content

Commit

Permalink
ImDrawList::ChannelsSplit(), ImDrawListSlitter: Fixed an issue with m…
Browse files Browse the repository at this point in the history
…erging draw commands between channels 0 and 1. (#2624) Introduced by cef88f6.
  • Loading branch information
ocornut committed Jun 14, 2019
1 parent af3080b commit 2645a25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion imgui_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand Down

0 comments on commit 2645a25

Please sign in to comment.