use crate::types::rect::Rect;
pub fn aspect_ratio(width: f64, ratio: f64) -> (f64, f64) {
(width, width / ratio)
}
pub fn fit_in_bounds(content_width: f64, content_height: f64, max_width: f64, max_height: f64) -> (f64, f64) {
let width_ratio = max_width / content_width;
let height_ratio = max_height / content_height;
let scale = width_ratio.min(height_ratio);
(content_width * scale, content_height * scale)
}
pub fn modal_rect(screen_width: f64, screen_height: f64, modal_width: f64, modal_height: f64) -> Rect {
let x = (screen_width - modal_width) / 2.0;
let y = (screen_height - modal_height) / 2.0;
Rect::new(x, y, modal_width, modal_height)
}