Nav: storing NavRect in LastItemData. Fix race condition where framed items (Rect != NavRect) calling SetFocusID() would store the wrong NavRectRel until next frame

(haven't dugged in the possible side-effects of that race condition)
This commit is contained in:
ocornut
2021-09-01 12:07:17 +02:00
parent ee351d3548
commit a735a8c084
3 changed files with 5 additions and 3 deletions

View File

@ -1124,6 +1124,7 @@ struct ImGuiLastItemData
ImGuiItemFlags InFlags; // See ImGuiItemFlags_
ImGuiItemStatusFlags StatusFlags; // See ImGuiItemStatusFlags_
ImRect Rect; // Full rectangle
ImRect NavRect; // Navigation scoring rectangle (not displayed)
ImRect DisplayRect; // Display rectangle (only if ImGuiItemStatusFlags_HasDisplayRect is set)
ImGuiLastItemData() { memset(this, 0, sizeof(*this)); }