Page MenuHome

Fix T87749: Fix text jitter in buttons with icons
ClosedPublic

Authored by Leon Schittek (lone_noel) on Apr 23 2021, 10:19 PM.

Details

Summary

This patch fixes the remaining issues described in T87749. The jitter is caused by inconsistent rounding when using the floats icon_size and icon_padding to offset the bound for the text drawing.
Using round_fl_to_int leads to consistent results and fixes the jitter that still occurred in some buttons with icons, UI lists, and breadcrumbs.

masterpatch

Diff Detail

Repository
rB Blender

Event Timeline

Leon Schittek (lone_noel) requested review of this revision.Apr 23 2021, 10:19 PM
Leon Schittek (lone_noel) created this revision.

This jitters because "icon_size" varies slightly and can be a range like 15.9998 - 16.0002 which will trunc to different numbers. icon_padding doesn't change the same way.

However, this patch does improve it a lot by adding this rounding. But, not completely because afterward text_padding (shown as line 2423 above) is added which can also vary in the same way. Round that too and all the jiggling goes away for me.

Whoops, sorry ignore my comment above. I didn't notice that you have https://developer.blender.org/D11060 as well.

This revision is now accepted and ready to land.Apr 26 2021, 9:25 PM

Agh, sorry, when committing I forgot to enter the author field. Sorry about that @Leon Schittek (lone_noel). I shouldn't do this late at night...