Skip to content

Commit

Permalink
Fixed cases where CTRL+Tab or Modal can occasionally lead to the crea…
Browse files Browse the repository at this point in the history
…tion of ImDrawCmd with zero triangles. (#4857, #5937)

Amend b0a6cd6
  • Loading branch information
ocornut committed Dec 1, 2022
1 parent 66ad2ad commit 9825f7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ Breaking changes:

Other changes:

- Fixed cases where CTRL+Tab or Modal can occasionally lead to the creation of ImDrawCmd with
zero triangles, which would makes the render loop of some backends assert (e.g. Metal with
debugging, Allegro). (#4857, #5937)
- Inputs, Scrolling: better selection of scrolling window when hovering nested windows
and when backend/OS is emitting dual-axis wheeling inputs (typically touch pads on macOS).
We now select a primary axis based on recent events, and select a target window based on it.
Expand Down
3 changes: 1 addition & 2 deletions imgui_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,7 @@ void ImDrawList::_PopUnusedDrawCmd()
{
if (CmdBuffer.Size == 0)
return;
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
if (curr_cmd->ElemCount == 0 && curr_cmd->UserCallback == NULL)
for (ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1]; curr_cmd->ElemCount == 0 && curr_cmd->UserCallback == NULL; curr_cmd--)
CmdBuffer.pop_back();
}

Expand Down

0 comments on commit 9825f7f

Please sign in to comment.