mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-22 21:00:41 +00:00
Merge branch 'master' into docking
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.91.2
|
||||
// dear imgui, v1.91.3 WIP
|
||||
// (widgets code)
|
||||
|
||||
/*
|
||||
@@ -1005,9 +1005,10 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS6
|
||||
const int held_dir = (clicked_v_norm < grab_v_norm) ? -1 : (clicked_v_norm > grab_v_norm + grab_h_norm) ? +1 : 0;
|
||||
if (g.ActiveIdIsJustActivated)
|
||||
{
|
||||
// On initial click calculate the distance between mouse and the center of the grab
|
||||
g.ScrollbarSeekMode = (short)held_dir;
|
||||
g.ScrollbarClickDeltaToGrabCenter = (g.ScrollbarSeekMode == 0.0f) ? clicked_v_norm - grab_v_norm - grab_h_norm * 0.5f : 0.0f;
|
||||
// On initial click when held_dir == 0 (clicked over grab): calculate the distance between mouse and the center of the grab
|
||||
const bool scroll_to_clicked_location = (g.IO.ConfigScrollbarScrollByPage == false || g.IO.KeyShift || held_dir == 0);
|
||||
g.ScrollbarSeekMode = scroll_to_clicked_location ? 0 : (short)held_dir;
|
||||
g.ScrollbarClickDeltaToGrabCenter = (held_dir == 0 && !g.IO.KeyShift) ? clicked_v_norm - grab_v_norm - grab_h_norm * 0.5f : 0.0f;
|
||||
}
|
||||
|
||||
// Apply scroll (p_scroll_v will generally point on one member of window->Scroll)
|
||||
|
||||
Reference in New Issue
Block a user