raphlinus / font-rs

Apache License 2.0
753 stars 49 forks source link

Fix incorrect rounding of size #34

Closed raphlinus closed 5 years ago

raphlinus commented 5 years ago

Using "size" to guide binary search is problematic because the upper half and lower half of the search region might be off by one. This patch uses a "start/end" representation of the search region rather than "middle/size", which makes the logic more robust.

Fixes #32

raphlinus commented 5 years ago

@golddranks Does this fix it for you?

golddranks commented 5 years ago

I'll test it out, just a sec.

golddranks commented 5 years ago

Yes, that fixes it!