functora-egui 0.2.0

shadcn/ui-inspired widget library for egui - buttons, inputs, selects, dialogs, and 70+ more components with light/dark theming
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! `AspectRatio` builder struct — a container that enforces a width:height ratio.

/// A container that constrains content to a specific aspect ratio.
#[must_use]
pub struct AspectRatio {
    pub(crate) ratio: f32,
}

impl AspectRatio {
    /// Creates a new aspect ratio container. `ratio` is width/height (e.g. 16.0/9.0).
    pub fn new(ratio: f32) -> Self {
        Self { ratio }
    }
}