Skip to content

Commit

Permalink
Scrollbar: Shift+Click always use absolute positionning scroll. (#8002,
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Sep 20, 2024
1 parent 4aeae5d commit a727332
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Breaking changes:

Other changes:

- Scrollbar: Shift+Click always use absolute positionning scroll (which was the default
before 1.90.8). (#8002, #7328)
- Backends: SDL3: Update for API changes: SDL_bool removal. SDL_INIT_TIMER removal.


Expand Down
4 changes: 2 additions & 2 deletions imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1000,8 +1000,8 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS6
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;
g.ScrollbarSeekMode = g.IO.KeyShift ? 0 : (short)held_dir;
g.ScrollbarClickDeltaToGrabCenter = (g.ScrollbarSeekMode == 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)
Expand Down

0 comments on commit a727332

Please sign in to comment.