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/rectangle.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/src/rectangle.rs') diff --git a/core/src/rectangle.rs b/core/src/rectangle.rs index 4fe91519..c6e6fce4 100644 --- a/core/src/rectangle.rs +++ b/core/src/rectangle.rs @@ -111,6 +111,12 @@ impl Rectangle { } } +impl std::cmp::PartialOrd for Rectangle { + fn partial_cmp(&self, other: &Self) -> Option { + (self.width * self.height).partial_cmp(&(other.width * other.height)) + } +} + impl std::ops::Mul for Rectangle { type Output = Self; -- cgit