1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-28 17:40:56 +01:00

ImDrawList: fixed non-merged commands when equal clip rectangles are in the two first commands

This commit is contained in:
ocornut 2015-07-06 20:38:06 -06:00
parent 5782c69c2a
commit a17e47fe14

View File

@ -9025,7 +9025,7 @@ void ImDrawList::UpdateClipRect()
else
{
ImVec4 current_clip_rect = clip_rect_stack.empty() ? GNullClipRect : clip_rect_stack.back();
if (commands.size() > 2 && ImLengthSqr(commands[commands.size()-2].clip_rect - current_clip_rect) < 0.00001f)
if (commands.size() >= 2 && ImLengthSqr(commands[commands.size()-2].clip_rect - current_clip_rect) < 0.00001f)
commands.pop_back();
else
current_cmd->clip_rect = current_clip_rect;