1
0
Fork 0
forked from wry/wry

Merge pull request #801 from mahkoh/jorth/negative-scaling

scale: round halfway away from zero
This commit is contained in:
mahkoh 2026-03-15 01:19:08 +01:00 committed by GitHub
commit ec74723e40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,7 +49,7 @@ impl Scale {
return v; return v;
} }
let scale = self.0 as i64; 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)
} }
} }