MultiSelect: Added IMGUI_HAS_MULTI_SELECT define. Fixed right-click toggling selection without clearing active id, could lead to MarkItemEdited() asserting. Fixed demo.

This commit is contained in:
omar
2019-04-15 19:13:36 +02:00
committed by ocornut
parent 8947c35fa1
commit 57da88093f
3 changed files with 5 additions and 2 deletions

View File

@@ -7258,7 +7258,9 @@ void ImGui::MultiSelectItemFooter(ImGuiID id, bool* p_selected, bool* p_pressed)
bool hovered = IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup);
if (hovered && IsMouseClicked(1))
{
SetFocusID(g.LastItemData.ID, window);
if (g.ActiveId != 0 && g.ActiveId != id)
ClearActiveID();
SetFocusID(id, window);
if (!pressed && !selected)
{
pressed = true;