mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Demo: fixed multi-selection tree nodes demo to not replace selection when clicking on single-item that's already part of selection (#581)
This commit is contained in:
parent
8f4b123e1b
commit
b5521a81d4
1 changed files with 3 additions and 3 deletions
|
|
@ -275,9 +275,9 @@ void ImGui::ShowTestWindow(bool* p_open)
|
|||
{
|
||||
// Update selection state. Process outside of tree loop to avoid visual inconsistencies during the clicking-frame.
|
||||
if (ImGui::GetIO().KeyCtrl)
|
||||
selection_mask ^= (1 << node_clicked); // CTRL+click to toggle
|
||||
else
|
||||
selection_mask = (1 << node_clicked); // Click to single-select
|
||||
selection_mask ^= (1 << node_clicked); // CTRL+click to toggle
|
||||
else if (!(selection_mask & (1 << node_clicked))) // If there is already a selection don't replace we clicked node is part of it
|
||||
selection_mask = (1 << node_clicked); // Click to single-select
|
||||
}
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue