Skip to main content

fit_within_square

Function fit_within_square 

Source
fn fit_within_square(size: Vec2, max_side: f32) -> Vec2
Expand description

Scales size down (never up) to fit within a max_side-by-max_side square, preserving its aspect ratio.