Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[read-fonts] revert midpoint change to match FT
A recent PR to fix an overflow changed the midpoint calculation from `(a + b) / 2` to the "equivalent" `a + (b - a) / 2` to attempt to avoid overflow with large values but this ends up producing results that don't exactly match FreeType in some cases. This just changes the expression to `a.wrapping_add(b) / 2` to restore compatibility while still avoiding the panic on overflow.
- Loading branch information