mirror of
https://github.com/ocornut/imgui.git
synced 2026-03-27 23:37:03 -05:00
Scrollbar: Fixed an issue which could lead initial click to move the current scroll by a pixel.
This commit is contained in:
@@ -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().
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user