idek stuff like stack
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::{Dir, Painter, Sign, UINum, UiRegion, UIScalar, Widget, WidgetId};
|
||||
use crate::{Dir, Painter, Sign, UiNum, UiRegion, UIScalar, Widget, WidgetId};
|
||||
|
||||
pub struct Span {
|
||||
pub children: Vec<(WidgetId, SpanLen)>,
|
||||
@@ -80,19 +80,19 @@ pub enum SpanLen {
|
||||
Relative(f32),
|
||||
}
|
||||
|
||||
pub fn fixed<N: UINum>(x: N) -> SpanLen {
|
||||
pub fn fixed<N: UiNum>(x: N) -> SpanLen {
|
||||
SpanLen::Fixed(x.to_f32())
|
||||
}
|
||||
|
||||
pub fn ratio<N: UINum>(x: N) -> SpanLen {
|
||||
pub fn ratio<N: UiNum>(x: N) -> SpanLen {
|
||||
SpanLen::Ratio(x.to_f32())
|
||||
}
|
||||
|
||||
pub fn rel<N: UINum>(x: N) -> SpanLen {
|
||||
pub fn rel<N: UiNum>(x: N) -> SpanLen {
|
||||
SpanLen::Relative(x.to_f32())
|
||||
}
|
||||
|
||||
impl<N: UINum> From<N> for SpanLen {
|
||||
impl<N: UiNum> From<N> for SpanLen {
|
||||
fn from(value: N) -> Self {
|
||||
Self::Ratio(value.to_f32())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user