Skip to content

Commit

Permalink
Nav: Selectable(): activating selectable also sets NavId + removed th…
Browse files Browse the repository at this point in the history
…e MouseDelta test (added in 43ee5d7, #323) as I don't think it is needed. (#787)
  • Loading branch information
ocornut committed Oct 3, 2017
1 parent 64a5132 commit cb4e6c8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9788,11 +9788,12 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
selected = false;

// Hovering selectable with mouse updates NavId accordingly so navigation can be resumed with gamepad/keyboard (this doesn't happen on most widgets)
if (hovered && !g.NavDisableMouseHover && g.NavWindow == window && (g.IO.MouseDelta.x != 0.0f || g.IO.MouseDelta.y != 0.0f))
{
g.NavDisableHighlight = true;
SetNavId(id, window->DC.NavLayerCurrent);
}
if (pressed || hovered)// && (g.IO.MouseDelta.x != 0.0f || g.IO.MouseDelta.y != 0.0f))
if (!g.NavDisableMouseHover && g.NavWindow == window)
{
g.NavDisableHighlight = true;
SetNavId(id, window->DC.NavLayerCurrent);
}

// Render
if (hovered || selected)
Expand Down

0 comments on commit cb4e6c8

Please sign in to comment.