Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions crates/bevy_ui/src/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,18 @@ impl Neg for Val {
}
}

impl From<f32> for Val {
fn from(value: f32) -> Self {
Val::Px(value)
}
}

impl From<i32> for Val {
fn from(value: i32) -> Self {
Val::Px(value as f32)
}
}

#[derive(Debug, Eq, PartialEq, Clone, Copy, Error)]
pub enum ValArithmeticError {
#[error("the given variant of Val is not evaluable (non-numeric)")]
Expand Down
Loading