From 9f85e0c721927f1e3bd195a998ec7a80ec0e7455 Mon Sep 17 00:00:00 2001 From: bungoboingo Date: Sat, 24 Dec 2022 21:27:44 -0800 Subject: Reworked Scrollable to account for lack of widget order guarantees. Fixed thumb "snapping" bug on scrollable when cursor is out of bounds. --- core/src/point.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/src/point.rs') diff --git a/core/src/point.rs b/core/src/point.rs index 9bf7726b..d351befd 100644 --- a/core/src/point.rs +++ b/core/src/point.rs @@ -75,3 +75,11 @@ impl std::ops::Sub for Point { Vector::new(self.x - point.x, self.y - point.y) } } + +impl std::ops::Add for Point { + type Output = Point; + + fn add(self, point: Point) -> Point { + Point::new(self.x + point.x, self.y + point.y) + } +} -- cgit