From 6315716f23a8de4e08c29d8258142d1f7f209824 Mon Sep 17 00:00:00 2001 From: Rokas Kupstys Date: Sat, 19 Feb 2022 10:22:24 +0200 Subject: [PATCH] Backends: Glut: Fix comparison operator precedence. --- backends/imgui_impl_glut.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/imgui_impl_glut.cpp b/backends/imgui_impl_glut.cpp index d3e638b5..1bf036b5 100644 --- a/backends/imgui_impl_glut.cpp +++ b/backends/imgui_impl_glut.cpp @@ -269,7 +269,7 @@ void ImGui_ImplGLUT_MouseFunc(int glut_button, int state, int x, int y) if (glut_button == GLUT_LEFT_BUTTON) button = 0; if (glut_button == GLUT_RIGHT_BUTTON) button = 1; if (glut_button == GLUT_MIDDLE_BUTTON) button = 2; - if (button != -1 && state == GLUT_DOWN || state == GLUT_UP) + if (button != -1 && (state == GLUT_DOWN || state == GLUT_UP)) io.AddMouseButtonEvent(button, state == GLUT_DOWN); }