pub fn clip(self, mut pos: Vec2<f32>) -> Vec2<f32> {
        if pos.x < self.min.x {
            pos.x = self.min.x;
        } else if pos.x > self.max.x {
            pos.x = self.max.x;
        }

        if pos.y < self.min.y {
            pos.y = self.min.y;
        } else if pos.y > self.max.y {
            pos.y = self.max.y;
        }

        return pos;
    }
/// Clips the given position to inside this region
Clips the given position to inside this region
Clips the given position to inside this region
pub fn clip(self, mut pos: Vec2<f32>) -> Vec2<f32> {
        if pos.x < self.min.x {
            pos.x = self.min.x;
        } else if pos.x > self.max.x {
            pos.x = self.max.x;
        }
        if pos.y < self.min.y {
            pos.y = self.min.y;
        } else if pos.y > self.max.y {
            pos.y = self.max.y;
        }
        return pos;
    }
pub fn clip ( self , mut pos : Vec2 < f32 > ) -> Vec2 < f32 > { if pos . x < self . min . x { pos . x = self . min . x ; } else if pos . x > self . max . x { pos . x = self . max . x ; } if pos . y < self . min . y { pos . y = self . min . y ; } else if pos . y > self . max . y { pos . y = self . max . y ; } return pos ; }
Clips the given position to inside this region
Clips the given position to inside this region
self
pos
Vec2<f32>
self
pos
Vec2<f32>