Previous 199869 Revisions Next

r33938 Thursday 18th December, 2014 at 07:27:14 UTC by Fabrice Bellet
debug: fix the gui for smaller fonts

Using a font pointsize different from 11pt has a consequence that
fontWidth (in pixels) is not an integer anymore.
[src/osd/modules/debugger/qt]debugqtmemorywindow.c debugqtview.c

trunk/src/osd/modules/debugger/qt/debugqtmemorywindow.c
r242449r242450
280280   if (leftClick || rightClick)
281281   {
282282      QFontMetrics actualFont = fontMetrics();
283      const int fontWidth = MAX(1, actualFont.width('_'));
283      const double fontWidth = actualFont.width(QString(100, '_')) / 100.;
284284      const int fontHeight = MAX(1, actualFont.height());
285285
286286      debug_view_xy topLeft = view()->visible_position();
trunk/src/osd/modules/debugger/qt/debugqtview.c
r242449r242450
152152{
153153   // Tell the MAME debug view how much real estate is available
154154   QFontMetrics actualFont = fontMetrics();
155   const int fontWidth = MAX(1, actualFont.width('_'));
155   const double fontWidth = actualFont.width(QString(100, '_')) / 100.;
156156   const int fontHeight = MAX(1, actualFont.height());
157157   m_view->set_visible_size(debug_view_xy(width()/fontWidth, height()/fontHeight));
158158
r242449r242450
344344   if (event->button() == Qt::LeftButton)
345345   {
346346      QFontMetrics actualFont = fontMetrics();
347      const int fontWidth = MAX(1, actualFont.width('_'));
347      const double fontWidth = actualFont.width(QString(100, '_')) / 100.;
348348      const int fontHeight = MAX(1, actualFont.height());
349349
350350      debug_view_xy topLeft = m_view->visible_position();


Previous 199869 Revisions Next


© 1997-2024 The MAME Team