mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
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.
This commit is contained in:
parent
6b98aa281a
commit
1417b6be30
@ -280,7 +280,7 @@ void DebuggerMemView::mousePressEvent(QMouseEvent* event)
|
||||
if (leftClick || rightClick)
|
||||
{
|
||||
QFontMetrics actualFont = fontMetrics();
|
||||
const int fontWidth = MAX(1, actualFont.width('_'));
|
||||
const double fontWidth = actualFont.width(QString(100, '_')) / 100.;
|
||||
const int fontHeight = MAX(1, actualFont.height());
|
||||
|
||||
debug_view_xy topLeft = view()->visible_position();
|
||||
|
@ -152,7 +152,7 @@ void DebuggerView::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
// Tell the MAME debug view how much real estate is available
|
||||
QFontMetrics actualFont = fontMetrics();
|
||||
const int fontWidth = MAX(1, actualFont.width('_'));
|
||||
const double fontWidth = actualFont.width(QString(100, '_')) / 100.;
|
||||
const int fontHeight = MAX(1, actualFont.height());
|
||||
m_view->set_visible_size(debug_view_xy(width()/fontWidth, height()/fontHeight));
|
||||
|
||||
@ -344,7 +344,7 @@ void DebuggerView::mousePressEvent(QMouseEvent* event)
|
||||
if (event->button() == Qt::LeftButton)
|
||||
{
|
||||
QFontMetrics actualFont = fontMetrics();
|
||||
const int fontWidth = MAX(1, actualFont.width('_'));
|
||||
const double fontWidth = actualFont.width(QString(100, '_')) / 100.;
|
||||
const int fontHeight = MAX(1, actualFont.height());
|
||||
|
||||
debug_view_xy topLeft = m_view->visible_position();
|
||||
|
Loading…
Reference in New Issue
Block a user