Center button label vertically, too (possible now that the GUI scaling is off)

svn-id: r18117
This commit is contained in:
Max Horn 2005-05-15 18:22:17 +00:00
parent ac215285d7
commit 8c3085eb2b

View File

@ -169,11 +169,8 @@ void ButtonWidget::handleMouseUp(int x, int y, int button, int clickCount) {
void ButtonWidget::drawWidget(bool hilite) {
NewGui *gui = &g_gui;
// HACK: Subtracting 1 from _y isn't very nice when we don't know
// anything about the size of the font. But we can't use the size of
// the font either, because we don't know how the coordinates will be
// scaled.
gui->drawString(_font, _label, _x, _y - 1, _w,
const int off = (_h - _font->getFontHeight()) / 2;
gui->drawString(_font, _label, _x, _y + off, _w,
!isEnabled() ? gui->_color :
hilite ? gui->_textcolorhi : gui->_textcolor, _align);
}