HaxeFlixel / flixel

Free, cross-platform 2D game engine powered by Haxe and OpenFL
https://haxeflixel.com/
MIT License
1.92k stars 427 forks source link

Ignore border outline when computing field size #3193

Closed Geokureli closed 1 week ago

Geokureli commented 1 week ago

computeTextSize was checking borderSize for some reason, causing odd bg placement below, where the border extends above the top, but the bg is padded ~2 pixels on the bottom and right. No where else while adding text is the border style considered, which contributes to the misalignment

Old version

image it also looks weird without border, because when borderStyle is NONE, borderSize was still often 1 (the default value) image

New Version

The border will hang evenly over the top and bottom, which is not perfect, but can easily be improved by setting padding to 2, or something

With border, 2 padding:

Screenshot 2024-06-22 at 12 16 54 PM

Without border, 0 padding:

Screenshot 2024-06-22 at 11 54 48 AM