Skip to content

Commit

Permalink
Scrolling: internal scrolling value is rounded instead of truncated. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Dec 7, 2023
1 parent c58d2c8 commit 5366bd0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Other changes:

- 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
Expand Down
2 changes: 1 addition & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10122,7 +10122,7 @@ static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window)
}
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]);
}
Expand Down

0 comments on commit 5366bd0

Please sign in to comment.