Improve nudging when tilted and add Artboard tool nudge resizing; disable menu bar entries when no layer is selected (#2098)

* Make nudging follow a tilted viewport

* Add artboard nudge resizing
This commit is contained in:
Keavon Chambers 2024-11-08 16:16:20 -08:00 committed by GitHub
parent 320d030c08
commit 457619794b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 237 additions and 115 deletions

View file

@ -163,12 +163,14 @@ fn random<U: num_traits::float::Float>(
// To u32
#[node_macro::node(name("To u32"), category("Math: Numeric"))]
fn to_u32<U: num_traits::float::Float>(_: (), #[implementations(f64, f32)] value: U) -> u32 {
let value = U::clamp(value, U::from(0.).unwrap(), U::from(u32::MAX as f64).unwrap());
value.to_u32().unwrap()
}
// To u64
#[node_macro::node(name("To u64"), category("Math: Numeric"))]
fn to_u64<U: num_traits::float::Float>(_: (), #[implementations(f64, f32)] value: U) -> u64 {
let value = U::clamp(value, U::from(0.).unwrap(), U::from(u64::MAX as f64).unwrap());
value.to_u64().unwrap()
}