Fix height of vertical scroller in Scrollbar
This commit is contained in:
parent
bebb2b0252
commit
ed11b04f60
1 changed files with 4 additions and 4 deletions
|
|
@ -1364,15 +1364,15 @@ impl Scrollbars {
|
|||
|
||||
let ratio = bounds.height / content_bounds.height;
|
||||
// min height for easier grabbing with super tall content
|
||||
let scroller_height = (bounds.height * ratio).max(2.0);
|
||||
let scroller_offset = translation.y * ratio;
|
||||
let scroller_height = (scrollbar_bounds.height * ratio).max(2.0);
|
||||
let scroller_offset =
|
||||
translation.y * ratio * scrollbar_bounds.height / bounds.height;
|
||||
|
||||
let scroller_bounds = Rectangle {
|
||||
x: bounds.x + bounds.width
|
||||
- total_scrollbar_width / 2.0
|
||||
- scroller_width / 2.0,
|
||||
y: (scrollbar_bounds.y + scroller_offset - x_scrollbar_height)
|
||||
.max(0.0),
|
||||
y: (scrollbar_bounds.y + scroller_offset).max(0.0),
|
||||
width: scroller_width,
|
||||
height: scroller_height,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue