Round translation to integral units in scrollable
This commit is contained in:
parent
5929b26722
commit
3881d68b7e
1 changed files with 14 additions and 10 deletions
|
|
@ -1633,20 +1633,24 @@ impl State {
|
||||||
) -> Vector {
|
) -> Vector {
|
||||||
Vector::new(
|
Vector::new(
|
||||||
if let Some(horizontal) = direction.horizontal() {
|
if let Some(horizontal) = direction.horizontal() {
|
||||||
self.offset_x.translation(
|
self.offset_x
|
||||||
bounds.width,
|
.translation(
|
||||||
content_bounds.width,
|
bounds.width,
|
||||||
horizontal.alignment,
|
content_bounds.width,
|
||||||
)
|
horizontal.alignment,
|
||||||
|
)
|
||||||
|
.round()
|
||||||
} else {
|
} else {
|
||||||
0.0
|
0.0
|
||||||
},
|
},
|
||||||
if let Some(vertical) = direction.vertical() {
|
if let Some(vertical) = direction.vertical() {
|
||||||
self.offset_y.translation(
|
self.offset_y
|
||||||
bounds.height,
|
.translation(
|
||||||
content_bounds.height,
|
bounds.height,
|
||||||
vertical.alignment,
|
content_bounds.height,
|
||||||
)
|
vertical.alignment,
|
||||||
|
)
|
||||||
|
.round()
|
||||||
} else {
|
} else {
|
||||||
0.0
|
0.0
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue