[fvar] Use roundf instead hardcoding round logic

This commit is contained in:
Ebrahim Byagowi 2019-08-07 20:22:20 +04:30 committed by Behdad Esfahbod
parent 60485ab047
commit 1f926fb2b6

View File

@ -237,7 +237,7 @@ struct fvar
v = (v - axis.default_value) / (axis.default_value - axis.min_value);
else
v = (v - axis.default_value) / (axis.max_value - axis.default_value);
return (int) (v * 16384.f + (v >= 0.f ? .5f : -.5f));
return roundf (v * 16384.f);
}
unsigned int get_instance_count () const { return instanceCount; }