Skip to content

Commit 9aa764c

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

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-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

+1
Original file line numberDiff line numberDiff line change
@@ -4528,6 +4528,7 @@ static void ImGui::RenderDimmedBackgrounds()
45284528
window->DrawList->PushClipRect(viewport->Pos, viewport->Pos + viewport->Size);
45294529
window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha), window->WindowRounding, 0, 3.0f);
45304530
window->DrawList->PopClipRect();
4531+
window->DrawList->_PopUnusedDrawCmd(); // Since are past the calls to AddDrawListToDrawData() we don't have a _PopUnusedDrawCmd() running on commands, let's simply avoid creating empty commands.
45314532
}
45324533
}
45334534

0 commit comments

Comments
 (0)