pub trait ClampXy<T> {
fn clamp_xy(&self, min: T, max: T) -> Self;
}
Required Methods
Return self.x and self.y clamped between min and max (both inclusive)
min and max can be primitives (such as usize) or structs with x and y fields (such as Point)
If they are primitive then both self.x
and self.y
will be clamped using the same value otherwise
self.x
will only clamped by min.x
and max.x
and the same for y