1
0
Fork 0
forked from wry/wry

scale: round halfway away from zero

This commit is contained in:
Julian Orth 2026-03-15 01:15:57 +01:00
parent fa7c2a02d0
commit 9c88dfd784

View file

@ -49,7 +49,7 @@ impl Scale {
return v;
}
let scale = self.0 as i64;
v.map(|v| ((v as i64 * scale + BASE64 / 2) / BASE64) as i32)
v.map(|v| ((v as i64 * scale + v.signum() as i64 * BASE64 / 2) / BASE64) as i32)
}
}