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

Fixed a situation where CTRL+Tab or Modal can occasionally lead to the creation of ImDrawCmd with zero triangles, (#4857)

(2nd amend)
This commit is contained in:
ocornut 2022-01-03 21:16:51 +01:00
parent 2402958aec
commit b0a6cd6305
2 changed files with 4 additions and 0 deletions

View File

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

View File

@ -4475,6 +4475,7 @@ static void ImGui::RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32
draw_list->CmdBuffer.pop_back(); draw_list->CmdBuffer.pop_back();
draw_list->CmdBuffer.push_front(cmd); draw_list->CmdBuffer.push_front(cmd);
draw_list->PopClipRect(); draw_list->PopClipRect();
draw_list->_PopUnusedDrawCmd(); // Since are past the calls to AddDrawListToDrawData() we don't have a _PopUnusedDrawCmd() running on commands.
} }
} }
@ -4528,6 +4529,7 @@ static void ImGui::RenderDimmedBackgrounds()
window->DrawList->PushClipRect(viewport->Pos, viewport->Pos + viewport->Size); window->DrawList->PushClipRect(viewport->Pos, viewport->Pos + viewport->Size);
window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha), window->WindowRounding, 0, 3.0f); window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha), window->WindowRounding, 0, 3.0f);
window->DrawList->PopClipRect(); window->DrawList->PopClipRect();
window->DrawList->_PopUnusedDrawCmd(); // Since are past the calls to AddDrawListToDrawData() we don't have a _PopUnusedDrawCmd() running on commands.
} }
} }