From 3fd4441f70744d888768def5e6ab4203b2cab582 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 9 Jun 2015 13:14:22 -0600 Subject: [PATCH] SetScrollPosHere() fixed imprecisions --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 91ce2e1e..8a7bbae7 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4646,7 +4646,7 @@ float ImGui::GetScrollMaxY() void ImGui::SetScrollPosHere() { ImGuiWindow* window = GetCurrentWindow(); - window->ScrollTargetCenterY = (window->DC.CursorPos.y + window->ScrollY) - window->DC.PrevLineHeight * 0.5f; + window->ScrollTargetCenterY = (float)(int)(window->DC.CursorPos.y + window->ScrollY - window->DC.PrevLineHeight * 0.5f); } void ImGui::SetKeyboardFocusHere(int offset)