mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-24 07:40:22 +01:00
parent
0770449630
commit
d8435c7710
2
imgui.h
2
imgui.h
@ -1840,7 +1840,7 @@ struct ImDrawListSplitter
|
||||
inline void Clear() { _Current = 0; _Count = 1; } // Do not clear Channels[] so our allocations are reused next frame
|
||||
IMGUI_API void ClearFreeMemory();
|
||||
IMGUI_API void Split(ImDrawList* draw_list, int count);
|
||||
IMGUI_API void Merge(ImDrawList* draw_lists);
|
||||
IMGUI_API void Merge(ImDrawList* draw_list);
|
||||
IMGUI_API void SetCurrentChannel(ImDrawList* draw_list, int channel_idx);
|
||||
};
|
||||
|
||||
|
@ -1267,12 +1267,13 @@ void ImDrawListSplitter::Merge(ImDrawList* draw_list)
|
||||
for (int i = 1; i < _Count; i++)
|
||||
{
|
||||
ImDrawChannel& ch = _Channels[i];
|
||||
if (ch.CmdBuffer.Size && ch.CmdBuffer.back().ElemCount == 0)
|
||||
if (ch.CmdBuffer.Size > 0 && ch.CmdBuffer.back().ElemCount == 0)
|
||||
ch.CmdBuffer.pop_back();
|
||||
else if (ch.CmdBuffer.Size > 0 && last_cmd != NULL && CanMergeDrawCommands(last_cmd, &ch.CmdBuffer[0]))
|
||||
if (ch.CmdBuffer.Size > 0 && last_cmd != NULL && CanMergeDrawCommands(last_cmd, &ch.CmdBuffer[0]))
|
||||
{
|
||||
// Merge previous channel last draw command with current channel first draw command if matching.
|
||||
last_cmd->ElemCount += ch.CmdBuffer[0].ElemCount;
|
||||
idx_offset += ch.CmdBuffer[0].ElemCount;
|
||||
ch.CmdBuffer.erase(ch.CmdBuffer.Data);
|
||||
}
|
||||
if (ch.CmdBuffer.Size > 0)
|
||||
|
Loading…
Reference in New Issue
Block a user