use lievisual::geometry::{Color, Point};
pub const DEFAULT_WIDTH: f64 = 800.0;
pub const DEFAULT_HEIGHT: f64 = 600.0;
#[derive(Debug, Clone)]
pub struct OutputConfig {
pub width: f64,
pub height: f64,
pub background: Color,
}
impl Default for OutputConfig {
fn default() -> Self {
Self {
width: DEFAULT_WIDTH,
height: DEFAULT_HEIGHT,
background: Color::new(255, 255, 255, 255),
}
}
}
pub fn center_in_rect(
text_w: f64,
text_h: f64,
rect_x: f64,
rect_y: f64,
rect_w: f64,
rect_h: f64,
) -> Point {
Point::new(
rect_x + (rect_w - text_w) / 2.0,
rect_y + (rect_h - text_h) / 2.0,
)
}