1
0
Fork 0
forked from wry/wry

tree: make scale and position of outputs persistent

This commit is contained in:
Julian Orth 2024-03-16 01:36:04 +01:00
parent bc9b1c3638
commit 3eb0f61ec1
16 changed files with 135 additions and 84 deletions

View file

@ -7,6 +7,12 @@ const BASEF: f64 = BASE as f64;
#[repr(transparent)]
pub struct Scale(u32);
impl Default for Scale {
fn default() -> Self {
Scale::from_int(1)
}
}
impl Scale {
pub fn from_int(f: u32) -> Self {
Self(f.saturating_mul(BASE))