AspectRatio builder
A container whose two dimensions stay in a fixed ratio.
A builder is RenderOnce. Construct and mount it in one expression.
use gpui_kit::layout::AspectRatio;
Construct
new(ident: impl Into<Ident>, ratio: f32) -> Self
of(ident: impl Into<Ident>, width: f32, height: f32) -> SelfOptions
Chain onto the value.
fit(fit: AspectFit) -> Self
width_driven() -> Self
height_driven() -> Self
child(child: impl IntoElement) -> SelfQueries
Only answer; they change nothing.
ratio() -> f32Rendered by
Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.