diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 6606c10d8..ec8abd87b 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -124,6 +124,7 @@ Other Changes: - Implemented a custom tweak to extend hit-testing bounding box when window is sitting at the edge of a viewport (e.g. fullscreen or docked window), so that e.g. mouse the mouse at the extreme of the screen will reach the scrollbar. (#9276) + - Fixed an issue which could lead initial click to move the current scroll by a pixel. - Button: - Moved ImGuiButtonFlags_AllowOverlap from imgui_internal.h to imgui.h, as a convenience for when using e.g. InvisibleButton(). diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 3022950e2..117733349 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -1042,7 +1042,7 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS6 IM_ASSERT(ImMax(size_contents_v, size_visible_v) > 0.0f); // Adding this assert to check if the ImMax(XXX,1.0f) is still needed. PLEASE CONTACT ME if this triggers. const ImS64 win_size_v = ImMax(ImMax(size_contents_v, size_visible_v), (ImS64)1); const float grab_h_minsize = ImMin(bb.GetSize()[axis], style.GrabMinSize); - const float grab_h_pixels = ImClamp(scrollbar_size_v * ((float)size_visible_v / (float)win_size_v), grab_h_minsize, scrollbar_size_v); + const float grab_h_pixels = (float)(int)ImClamp(scrollbar_size_v * ((float)size_visible_v / (float)win_size_v), grab_h_minsize, scrollbar_size_v); const float grab_h_norm = grab_h_pixels / scrollbar_size_v; // As a special thing, we allow scrollbar near the edge of a screen/viewport to be reachable with mouse at the extreme edge (#9276)