Page MenuHome

Fix T97310: BLF Line Height While Text Wrapping
ClosedPublic

Authored by Harley Acheson (harley) on Apr 13 2022, 8:13 PM.

Details

Summary

Fix word-wrapped tooltip text not showing by aligning to pixel grid.


With rBae43872ad572eb3e6ad1ebfd02921fc2403059bc blf_font_height_max_ft_pix gives subpixel result while blf_font_height_max gives a pixel-aligned integer value.

When tooptips are calculating the size of their area, they assume a line height from blf_font_height_max. However, when processing multiline content in blf_font_wrap_apply that function uses a line height of blf_font_height_max_ft_pix. Therefore the height of lines will be slightly taller than the room made for them - and they therefore get clipped out.

This patch just forces the line height in blf_font_wrap_apply to be pixel truncated. Ultimately Campbell might want to address this a little differently, but this at least fixes the issue.

Diff Detail

Repository
rB Blender

Event Timeline

This revision is now accepted and ready to land.Apr 14 2022, 2:10 AM
source/blender/blenfont/intern/blf_font.c
923

Worth noting why floor is needed in this case (with a reference to T97310).

Harley Acheson (harley) retitled this revision from Fix T97310: BLF Line Height to Fix T97310: BLF Line Height While Text Wrapping.
Harley Acheson (harley) edited the summary of this revision. (Show Details)

Updated comment and description.