Qt: Fix incorrect mouse button event being fired

Fixes left click bindings.
This commit is contained in:
Connor McLaughlin
2022-08-10 15:54:53 +10:00
parent f3ec05f1ba
commit ddbe28830e
2 changed files with 3 additions and 3 deletions

View File

@ -745,11 +745,11 @@ void ImGuiManager::UpdateMousePosition(float x, float y)
bool ImGuiManager::ProcessPointerButtonEvent(InputBindingKey key, float value)
{
if (!ImGui::GetCurrentContext() || (key.data - 1u) >= std::size(ImGui::GetIO().MouseDown))
if (!ImGui::GetCurrentContext() || key.data >= std::size(ImGui::GetIO().MouseDown))
return false;
// still update state anyway
ImGui::GetIO().AddMouseButtonEvent(key.data - 1, value != 0.0f);
ImGui::GetIO().AddMouseButtonEvent(key.data, value != 0.0f);
return s_imgui_wants_mouse.load(std::memory_order_acquire);
}