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
it also looks weird without border, because when borderStyle is NONE, borderSize was still often 1 (the default value)
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
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 misalignmentOld version
it also looks weird without border, because when borderStyle is NONE, borderSize was still often 1 (the default value)
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 somethingWith border, 2 padding:
Without border, 0 padding: