Fix Scrollbar bound calculations in Scrollable
This commit is contained in:
parent
570600ce51
commit
70483e7fdd
1 changed files with 12 additions and 9 deletions
|
|
@ -1116,8 +1116,9 @@ impl Scrollbars {
|
||||||
|
|
||||||
// Bounds of just the scrollbar
|
// Bounds of just the scrollbar
|
||||||
let scrollbar_bounds = Rectangle {
|
let scrollbar_bounds = Rectangle {
|
||||||
x: bounds.x + bounds.width - total_scrollbar_width / 2.0
|
x: bounds.x + bounds.width
|
||||||
+ width / 2.0,
|
- total_scrollbar_width / 2.0
|
||||||
|
- width / 2.0,
|
||||||
y: bounds.y,
|
y: bounds.y,
|
||||||
width,
|
width,
|
||||||
height: (bounds.height - x_scrollbar_height).max(0.0),
|
height: (bounds.height - x_scrollbar_height).max(0.0),
|
||||||
|
|
@ -1129,8 +1130,9 @@ impl Scrollbars {
|
||||||
let scroller_offset = offset.y * ratio;
|
let scroller_offset = offset.y * ratio;
|
||||||
|
|
||||||
let scroller_bounds = Rectangle {
|
let scroller_bounds = Rectangle {
|
||||||
x: bounds.x + bounds.width - total_scrollbar_width / 2.0
|
x: bounds.x + bounds.width
|
||||||
+ scroller_width / 2.0,
|
- total_scrollbar_width / 2.0
|
||||||
|
- scroller_width / 2.0,
|
||||||
y: (scrollbar_bounds.y + scroller_offset - x_scrollbar_height)
|
y: (scrollbar_bounds.y + scroller_offset - x_scrollbar_height)
|
||||||
.max(0.0),
|
.max(0.0),
|
||||||
width: scroller_width,
|
width: scroller_width,
|
||||||
|
|
@ -1175,8 +1177,9 @@ impl Scrollbars {
|
||||||
// Bounds of just the scrollbar
|
// Bounds of just the scrollbar
|
||||||
let scrollbar_bounds = Rectangle {
|
let scrollbar_bounds = Rectangle {
|
||||||
x: bounds.x,
|
x: bounds.x,
|
||||||
y: bounds.y + bounds.height - total_scrollbar_height / 2.0
|
y: bounds.y + bounds.height
|
||||||
+ width / 2.0,
|
- total_scrollbar_height / 2.0
|
||||||
|
- width / 2.0,
|
||||||
width: (bounds.width - scrollbar_y_width).max(0.0),
|
width: (bounds.width - scrollbar_y_width).max(0.0),
|
||||||
height: width,
|
height: width,
|
||||||
};
|
};
|
||||||
|
|
@ -1189,9 +1192,9 @@ impl Scrollbars {
|
||||||
let scroller_bounds = Rectangle {
|
let scroller_bounds = Rectangle {
|
||||||
x: (scrollbar_bounds.x + scroller_offset - scrollbar_y_width)
|
x: (scrollbar_bounds.x + scroller_offset - scrollbar_y_width)
|
||||||
.max(0.0),
|
.max(0.0),
|
||||||
y: bounds.y + bounds.height - total_scrollbar_height / 2.0
|
y: bounds.y + bounds.height
|
||||||
+ scroller_width / 2.0,
|
- total_scrollbar_height / 2.0
|
||||||
|
- scroller_width / 2.0,
|
||||||
width: scroller_length,
|
width: scroller_length,
|
||||||
height: scroller_width,
|
height: scroller_width,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue