Trait ViewportSize

Source
pub trait ViewportSize<T>
where T: Mul<ScaleFactor, Output = f32> + Copy + Ord + 'static, f32: AsPrimitive<T>,
{ // Required method fn scale_viewport( self, scaling: Scale2D, viewport: Size<T>, original: Size<T>, clamp: Option<T>, ) -> Size<T>; }
Expand description

Trait for size scaling relative to the viewport.

Required Methods§

Source

fn scale_viewport( self, scaling: Scale2D, viewport: Size<T>, original: Size<T>, clamp: Option<T>, ) -> Size<T>

Produce a Size<T> scaled with the input scaling options. The size will at minimum be 1x1, and at a maximum of the specified clamp value, or 16384x16384 if the clamp value is not specified.

Implementations on Foreign Types§

Source§

impl<T> ViewportSize<T> for Size<T>
where T: Mul<ScaleFactor, Output = f32> + Copy + Ord + 'static, f32: AsPrimitive<T>,

Source§

fn scale_viewport( self, scaling: Scale2D, viewport: Size<T>, original: Size<T>, clamp: Option<T>, ) -> Size<T>
where T: Mul<ScaleFactor, Output = f32> + Copy + Ord + 'static, f32: AsPrimitive<T>,

Implementors§