Browse Source

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

ocornut 10 years ago
parent
commit
a17e47fe14
1 changed files with 1 additions and 1 deletions
  1. 1 1
      imgui.cpp

+ 1 - 1
imgui.cpp

@@ -9025,7 +9025,7 @@ void ImDrawList::UpdateClipRect()
     else
     else
     {
     {
         ImVec4 current_clip_rect = clip_rect_stack.empty() ? GNullClipRect : clip_rect_stack.back();
         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();
             commands.pop_back();
         else
         else
             current_cmd->clip_rect = current_clip_rect;
             current_cmd->clip_rect = current_clip_rect;