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::new(
|
||||
if let Some(horizontal) = direction.horizontal() {
|
||||
self.offset_x.translation(
|
||||
bounds.width,
|
||||
content_bounds.width,
|
||||
horizontal.alignment,
|
||||
)
|
||||
self.offset_x
|
||||
.translation(
|
||||
bounds.width,
|
||||
content_bounds.width,
|
||||
horizontal.alignment,
|
||||
)
|
||||
.round()
|
||||
} else {
|
||||
0.0
|
||||
},
|
||||
if let Some(vertical) = direction.vertical() {
|
||||
self.offset_y.translation(
|
||||
bounds.height,
|
||||
content_bounds.height,
|
||||
vertical.alignment,
|
||||
)
|
||||
self.offset_y
|
||||
.translation(
|
||||
bounds.height,
|
||||
content_bounds.height,
|
||||
vertical.alignment,
|
||||
)
|
||||
.round()
|
||||
} else {
|
||||
0.0
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue