[Scummvm-cvs-logs] CVS: scummvm/gui widget.cpp,1.46,1.47
Max Horn
fingolfin at users.sourceforge.net
Sun May 15 11:22:58 CEST 2005
Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4140
Modified Files:
widget.cpp
Log Message:
Center button label vertically, too (possible now that the GUI scaling is off)
Index: widget.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/widget.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- widget.cpp 12 May 2005 15:46:03 -0000 1.46
+++ widget.cpp 15 May 2005 18:22:17 -0000 1.47
@@ -169,11 +169,8 @@
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);
}
More information about the Scummvm-git-logs
mailing list