Scrolling: internal scrolling value is rounded instead of truncated. (#6677)
diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt
index ff279d4..ffd6394 100644
--- a/docs/CHANGELOG.txt
+++ b/docs/CHANGELOG.txt
@@ -55,6 +55,8 @@
- Windows: BeginChild(): Fixed auto-resizing erroneously limiting size to host viewport
minus padding. There are no limit to a child width/height. (#7063) [@Devyre]
+- Scrolling: internal scrolling value is rounded instead of truncated, as a way to reduce
+ speed asymetry when (incorrectly) attempting to scroll by non-integer amount. (#6677)
- Nav, IO: SetNextFrameWantCaptureKeyboard(false) calls are not overrided back to true when
navigation is enabled. SetNextFrameWantCaptureKeyboard() is always higher priority. (#6997)
- Drag and Drop: Fixed drop target highlight on items temporarily pushing a widened clip rect
diff --git a/imgui.cpp b/imgui.cpp
index 84bc9d3..4bfe45c 100644
--- a/imgui.cpp
+++ b/imgui.cpp
@@ -10122,7 +10122,7 @@
}
scroll[axis] = scroll_target - center_ratio * (window->SizeFull[axis] - decoration_size[axis]);
}
- scroll[axis] = IM_TRUNC(ImMax(scroll[axis], 0.0f));
+ scroll[axis] = IM_ROUND(ImMax(scroll[axis], 0.0f));
if (!window->Collapsed && !window->SkipItems)
scroll[axis] = ImMin(scroll[axis], window->ScrollMax[axis]);
}