/// Calculate the size and position of an inner rectangle.
///
/// Subtracts the side offsets from all sides. The horizontal and vertical
/// offsets must not be larger than the original side length.
/// This method assumes y oriented downward.
Calculate the size and position of an inner rectangle.
Subtracts the side offsets from all sides. The horizontal and vertical
offsets must not be larger than the original side length.
This method assumes y oriented downward.
Calculate the size and position of an inner rectangle . Subtracts the side offsets from all sides . The horizontal and vertical offsets must not be larger than the original side length . This method assumes y oriented downward .
pub fn inner_rect(&self, offsets: SideOffsets2D<T, U>) -> Self {
        let rect = Rect::new(
            Point2D::new(
                self.origin.x + offsets.left,
                self.origin.y + offsets.top
            ),
            Size2D::new(
                self.size.width - offsets.horizontal(),
                self.size.height - offsets.vertical()
            )
        );
        debug_assert!(rect.size.width >= Zero::zero());
        debug_assert!(rect.size.height >= Zero::zero());
        rect
    }
pub fn inner_rect ( & self , offsets : SideOffsets2D < T , U > ) -> Self { let rect = Rect :: new ( Point2D :: new ( self . origin . x + offsets . left , self . origin . y + offsets . top ) , Size2D :: new ( self . size . width - offsets . horizontal ( ) , self . size . height - offsets . vertical ( ) ) ) ; debug_assert ! ( rect size width Zero zero ( ) ) ; debug_assert ! ( rect size height Zero zero ( ) ) ; rect }
Calculate the size and position of an inner rectangle.
Calculate the size and position of an inner rectangle .
&self
offsets
SideOffsets2D<T, U>