Minor fix to avoid undefined behavior sanitizer triggering (#3276)

This commit is contained in:
ocornut 2020-06-04 18:59:04 +02:00
parent 53dfccbe4b
commit 79fbab543d
1 changed files with 1 additions and 1 deletions

View File

@ -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
{