aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2005-05-15 18:22:17 +0000
committerMax Horn2005-05-15 18:22:17 +0000
commit8c3085eb2b1bcb054fda16561345a9fd9632fc00 (patch)
tree4bbf54c569dc21453c173c76d555bcef63218ddb
parentac215285d72ae179346d97c354968d259e20b8ab (diff)
downloadscummvm-rg350-8c3085eb2b1bcb054fda16561345a9fd9632fc00.tar.gz
scummvm-rg350-8c3085eb2b1bcb054fda16561345a9fd9632fc00.tar.bz2
scummvm-rg350-8c3085eb2b1bcb054fda16561345a9fd9632fc00.zip
Center button label vertically, too (possible now that the GUI scaling is off)
svn-id: r18117
-rw-r--r--gui/widget.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 0bc70e4a74..6683ff0bbc 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -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);
}