rust/integral-geometry/src/lib.rs
changeset 14725 19d30d96d7d6
parent 14717 16024046d458
child 14726 75ff5c643004
--- a/rust/integral-geometry/src/lib.rs	Wed Mar 27 09:52:08 2019 -0400
+++ b/rust/integral-geometry/src/lib.rs	Wed Mar 27 22:10:46 2019 +0300
@@ -311,7 +311,7 @@
 impl Rect {
     pub const EMPTY: Self = Self {
         top_left: Point::ZERO,
-        bottom_right: Point::ZERO,
+        bottom_right: Point::diag(-1),
     };
 
     #[inline]
@@ -454,9 +454,9 @@
     #[inline]
     pub fn with_margins(&self, left: i32, right: i32, top: i32, bottom: i32) -> Self {
         Self::from_box(
-            self.left() + left,
+            self.left() - left,
             self.right() + right,
-            self.top() + top,
+            self.top() - top,
             self.bottom() + bottom,
         )
     }