equal
deleted
inserted
replaced
494 (self.top_left() + self.bottom_right()) / 2 |
494 (self.top_left() + self.bottom_right()) / 2 |
495 } |
495 } |
496 |
496 |
497 #[inline] |
497 #[inline] |
498 pub fn with_margin(&self, margin: i32) -> Self { |
498 pub fn with_margin(&self, margin: i32) -> Self { |
499 let offset = Point::diag(margin); |
499 let offset = Point::new(min(margin, self.width() as i32 / 2), min(margin, self.height() as i32 / 2)); |
500 Self::new(self.top_left() + offset, self.bottom_right() - offset) |
500 Self::new(self.top_left() + offset, self.bottom_right() - offset) |
501 } |
501 } |
502 |
502 |
503 #[inline] |
503 #[inline] |
504 pub const fn x_range(&self) -> RangeInclusive<i32> { |
504 pub const fn x_range(&self) -> RangeInclusive<i32> { |