summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2016-06-19 08:37:09 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2016-06-19 08:37:09 +0200
commitc52754e79a46a9781af418cc6955b4c3ab5dfa5e (patch)
tree27ad2d38716c55fd670b741546ac1059734c704f /src
parentMerge pull request #1877 from wwylele/wait-fix-timeout (diff)
downloadyuzu-c52754e79a46a9781af418cc6955b4c3ab5dfa5e.tar
yuzu-c52754e79a46a9781af418cc6955b4c3ab5dfa5e.tar.gz
yuzu-c52754e79a46a9781af418cc6955b4c3ab5dfa5e.tar.bz2
yuzu-c52754e79a46a9781af418cc6955b4c3ab5dfa5e.tar.lz
yuzu-c52754e79a46a9781af418cc6955b4c3ab5dfa5e.tar.xz
yuzu-c52754e79a46a9781af418cc6955b4c3ab5dfa5e.tar.zst
yuzu-c52754e79a46a9781af418cc6955b4c3ab5dfa5e.zip
Diffstat (limited to 'src')
-rw-r--r--src/citra_qt/debugger/profiler.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/citra_qt/debugger/profiler.cpp b/src/citra_qt/debugger/profiler.cpp
index 585ac049a..17898f54b 100644
--- a/src/citra_qt/debugger/profiler.cpp
+++ b/src/citra_qt/debugger/profiler.cpp
@@ -151,8 +151,8 @@ private:
/// This timer is used to redraw the widget's contents continuously. To save resources, it only
/// runs while the widget is visible.
QTimer update_timer;
- /// Scale the coordinate system appropriately when physical DPI != logical DPI.
- qreal x_scale, y_scale;
+ /// Scale the coordinate system appropriately when dpi != 96.
+ qreal x_scale = 1.0, y_scale = 1.0;
};
#endif
@@ -222,15 +222,14 @@ MicroProfileWidget::MicroProfileWidget(QWidget* parent) : QWidget(parent) {
MicroProfileInitUI();
connect(&update_timer, SIGNAL(timeout()), SLOT(update()));
-
- QPainter painter(this);
- x_scale = qreal(painter.device()->physicalDpiX()) / qreal(painter.device()->logicalDpiX());
- y_scale = qreal(painter.device()->physicalDpiY()) / qreal(painter.device()->logicalDpiY());
}
void MicroProfileWidget::paintEvent(QPaintEvent* ev) {
QPainter painter(this);
+ // The units used by Microprofile for drawing are based in pixels on a 96 dpi display.
+ x_scale = qreal(painter.device()->logicalDpiX()) / 96.0;
+ y_scale = qreal(painter.device()->logicalDpiY()) / 96.0;
painter.scale(x_scale, y_scale);
painter.setBackground(Qt::black);
@@ -241,7 +240,7 @@ void MicroProfileWidget::paintEvent(QPaintEvent* ev) {
painter.setFont(font);
mp_painter = &painter;
- MicroProfileDraw(rect().width(), rect().height());
+ MicroProfileDraw(rect().width() / x_scale, rect().height() / y_scale);
mp_painter = nullptr;
}