Skip to content

Commit

Permalink
Minor fix to avoid undefined behavior sanitizer triggering (#3276)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Jun 4, 2020
1 parent 53dfccb commit 79fbab5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 79fbab5

Please sign in to comment.