Button (and presumably other widgets, like ToggleButton) correctly returns the text baseline if no icon is set. However, if an icon is set on the button the bottom part of that icon is returned instead, which is wrong.
Baseline is used to align the text vertically on the text's baseline even if for instance there is graphics or if there are differently sized fonts in the text.
This is how Swing worked and to my knowledge all other UI toolkits interprets baseline.
Baseline is used to align the text vertically on the text's baseline even if for instance there is graphics or if there are differently sized fonts in the text.
This is how Swing worked and to my knowledge all other UI toolkits interprets baseline.