Reworked Scrollable to account for lack of widget order guarantees.
Fixed thumb "snapping" bug on scrollable when cursor is out of bounds.
This commit is contained in:
parent
d91f4f6aa7
commit
9f85e0c721
9 changed files with 624 additions and 697 deletions
|
|
@ -75,3 +75,11 @@ impl std::ops::Sub<Point> for Point {
|
|||
Vector::new(self.x - point.x, self.y - point.y)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Add<Point> for Point {
|
||||
type Output = Point;
|
||||
|
||||
fn add(self, point: Point) -> Point {
|
||||
Point::new(self.x + point.x, self.y + point.y)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,6 +111,12 @@ impl Rectangle<f32> {
|
|||
}
|
||||
}
|
||||
|
||||
impl std::cmp::PartialOrd for Rectangle<f32> {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
|
||||
(self.width * self.height).partial_cmp(&(other.width * other.height))
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Mul<f32> for Rectangle<f32> {
|
||||
type Output = Self;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue