linebender / piet

An abstraction for 2D graphics.
Apache License 2.0
1.24k stars 93 forks source link

empty layout height does not match height with text #433

Open cmyr opened 3 years ago

cmyr commented 3 years ago

This is a problem on at least cairo and macOS, and is most obvious on cairo.

derekdreery commented 3 years ago

Driveby comment: I'm sure this is the same in the browser: if you have a <span> with nothing in it, it has height 0 whereas as soon as it has a letter in it the height is 1 line height.

cmyr commented 3 years ago

Yea, this is really specifically about text boxes; when they're empty we still want to know how tall the text would be if it existed, so that we can correctly size the box.