branch | transitional_engine |
changeset 16027 | d4675c190fa5 |
parent 16022 | 2003b466b279 |
child 16032 | 31cc1e450273 |
--- a/rust/integral-geometry/src/lib.rs Thu Aug 29 17:09:39 2024 +0200 +++ b/rust/integral-geometry/src/lib.rs Tue Sep 03 11:16:16 2024 +0200 @@ -496,7 +496,7 @@ #[inline] pub fn with_margin(&self, margin: i32) -> Self { - let offset = Point::diag(margin); + let offset = Point::new(min(margin, self.width() as i32 / 2), min(margin, self.height() as i32 / 2)); Self::new(self.top_left() + offset, self.bottom_right() - offset) }