pub fn clamp_view_origin(&self, origin: Point) -> Point {
        let x = origin
            .x
            .min(self.content_size.width - self.view_size.width)
            .max(0.0);
        let y = origin
            .y
            .min(self.content_size.height - self.view_size.height)
            .max(0.0);
        Point::new(x, y)
    }
/// Tries to find a position for the view rectangle that is contained in the content rectangle.
///
/// If the supplied origin is good, returns it; if it isn't, we try to return the nearest
/// origin that would make the view rectangle contained in the content rectangle. (This will
/// fail if the content is smaller than the view, and we return `0.0` in each dimension where
/// the content is smaller.)
Tries to find a position for the view rectangle that is contained in the content rectangle.
If the supplied origin is good, returns it; if it isn't, we try to return the nearest
origin that would make the view rectangle contained in the content rectangle. (This will
fail if the content is smaller than the view, and we return `0.0` in each dimension where
the content is smaller.)
Tries to find a position for the view rectangle that is contained in the content rectangle . If the supplied origin is good returns it ; if it isn ' t we try to return the nearest origin that would make the view rectangle contained in the content rectangle . ( This will fail if the content is smaller than the view and we return ` 0 . 0 ` in each dimension where the content is smaller . )
pub fn clamp_view_origin(&self, origin: Point) -> Point {
        let x = origin
            .x
            .min(self.content_size.width - self.view_size.width)
            .max(0.0);
        let y = origin
            .y
            .min(self.content_size.height - self.view_size.height)
            .max(0.0);
        Point::new(x, y)
    }
pub fn clamp_view_origin ( & self , origin : Point ) -> Point { let x = origin . x . min ( self . content_size . width - self . view_size . width ) . max ( 0.0 ) ; let y = origin . y . min ( self . content_size . height - self . view_size . height ) . max ( 0.0 ) ; Point :: new ( x , y ) }
Tries to find a position for the view rectangle that is contained in the content rectangle.
Tries to find a position for the view rectangle that is contained in the content rectangle .
&self
origin
Point
&self
origin
Point