Skip to content

Commit b0a6cd6

Browse files
committed
Fixed a situation where CTRL+Tab or Modal can occasionally lead to the creation of ImDrawCmd with zero triangles, (#4857)
(2nd amend)
1 parent 2402958 commit b0a6cd6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

docs/CHANGELOG.txt

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ Breaking Changes:
4646

4747
Other Changes:
4848

49+
- Fixed a situation where CTRL+Tab or Modal can occasionally lead to the creation of ImDrawCmd with zero triangles,
50+
which would makes the draw operation of some backends assert (e.g. Metal with debugging). (#4857)
4951
- Tables, ImDrawListSplitter: Fixed erroneously stripping trailing ImDrawList::AddCallback() when submitted in
5052
last column or last channel and when there are no other drawing operation. (#4843, #4844) [@hoffstadt]
5153
- Backends: OpenGL3: Fixed a buffer overflow in imgui_impl_opengl3_loader.h init (added in 1.86). (#4468, #4830) [@dymk]

imgui.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -4475,6 +4475,7 @@ static void ImGui::RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32
44754475
draw_list->CmdBuffer.pop_back();
44764476
draw_list->CmdBuffer.push_front(cmd);
44774477
draw_list->PopClipRect();
4478+
draw_list->_PopUnusedDrawCmd(); // Since are past the calls to AddDrawListToDrawData() we don't have a _PopUnusedDrawCmd() running on commands.
44784479
}
44794480
}
44804481

@@ -4528,6 +4529,7 @@ static void ImGui::RenderDimmedBackgrounds()
45284529
window->DrawList->PushClipRect(viewport->Pos, viewport->Pos + viewport->Size);
45294530
window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha), window->WindowRounding, 0, 3.0f);
45304531
window->DrawList->PopClipRect();
4532+
window->DrawList->_PopUnusedDrawCmd(); // Since are past the calls to AddDrawListToDrawData() we don't have a _PopUnusedDrawCmd() running on commands.
45314533
}
45324534
}
45334535

0 commit comments

Comments
 (0)