Fix no_std build

This fixes the `no_std` build and also makes sure it's tested properly
in the CI workflow.
This commit is contained in:
Christopher Serr 2024-02-12 17:34:28 +01:00 committed by Jeremy Soller
parent 0cb6eba6e7
commit 8582173128
8 changed files with 31 additions and 10 deletions

View file

@ -63,8 +63,9 @@ pub enum SubpixelBin {
impl SubpixelBin {
pub fn new(pos: f32) -> (i32, Self) {
let (fract, truncf) = libm::modff(pos);
let trunc = truncf as i32;
let trunc = pos as i32;
let fract = pos - trunc as f32;
if pos.is_sign_negative() {
if fract > -0.125 {
(trunc, Self::Zero)