Tweak CalcTextSize() awkward width rounding/ceiling code to reduce floating-point imprecisions altering the result by 1 even at relatively small width. (#791) + apply same fudge factor to less important roundings.

ceilf() is still measurable e.g. ballpark +0.5 for 200k calls.
This commit is contained in:
ocornut
2026-05-28 19:19:11 +02:00
parent 33bb693b4c
commit 12b7977555
4 changed files with 10 additions and 9 deletions

View File

@@ -55,6 +55,8 @@ Other Changes:
- Fonts:
- Added `IMGUI_DISABLE_DEFAULT_FONT_BITMAP`/`IMGUI_DISABLE_DEFAULT_FONT_VECTOR` to
disable embedding either fonts separately. (#9407)
- Tweak CalcTextSize() awkward width rounding/ceiling code to reduce floating-point
imprecisions altering the result by 1 even at relatively small width. (#791)
- DrawList:
- Minor optimization to AddLine(), AddLineH(), AddLineV() functions. (#4091)
- Demo: