From 79fbab543d229c8526d4d05078028f7fa0656c7b Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 4 Jun 2020 18:59:04 +0200 Subject: [PATCH] Minor fix to avoid undefined behavior sanitizer triggering (#3276) --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 82de5dfbddd0..b74f44cf8e90 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3516,7 +3516,7 @@ static void ImGui::UpdateMouseInputs() ImVec2 delta_from_click_pos = IsMousePosValid(&g.IO.MousePos) ? (g.IO.MousePos - g.IO.MouseClickedPos[i]) : ImVec2(0.0f, 0.0f); if (ImLengthSqr(delta_from_click_pos) < g.IO.MouseDoubleClickMaxDist * g.IO.MouseDoubleClickMaxDist) g.IO.MouseDoubleClicked[i] = true; - g.IO.MouseClickedTime[i] = -DBL_MAX; // so the third click isn't turned into a double-click + g.IO.MouseClickedTime[i] = -g.IO.MouseDoubleClickTime * 2.0f; // Mark as "old enough" so the third click isn't turned into a double-click } else {