summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qhighdpiscaling_p.h
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-03-22 07:24:57 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-03-22 07:28:42 +0100
commita02863234d76abb6c9f289026ae4ea3145924f30 (patch)
treeaef6381d0000a78ba69ac80eb03739b1c8ca5fc3 /src/gui/kernel/qhighdpiscaling_p.h
parente77b13621f0057374d83a2b884f03dd2e5b7b88c (diff)
parente4d79e1fdeb6b26ba0b12b578daacf7cd672b960 (diff)
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts: configure mkspecs/common/wince/qplatformdefs.h src/plugins/platforms/directfb/qdirectfbbackingstore.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp Change-Id: Ied4d31264a9afca9514b51a7eb1494c28712793c
Diffstat (limited to 'src/gui/kernel/qhighdpiscaling_p.h')
-rw-r--r--src/gui/kernel/qhighdpiscaling_p.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h
index a871fe0024..e790e3094f 100644
--- a/src/gui/kernel/qhighdpiscaling_p.h
+++ b/src/gui/kernel/qhighdpiscaling_p.h
@@ -472,8 +472,9 @@ QVector<T> fromNativePixels(const QVector<T> &pixelValues, const QWindow *window
QVector<T> pointValues;
pointValues.reserve(pixelValues.size());
+ const auto factor = QHighDpiScaling::factor(window);
for (const T &pixelValue : pixelValues)
- pointValues.append(pixelValue / QHighDpiScaling::factor(window));
+ pointValues.append(pixelValue / factor);
return pointValues;
}
@@ -486,8 +487,9 @@ QVector<T> toNativePixels(const QVector<T> &pointValues, const QWindow *window)
QVector<T> pixelValues;
pixelValues.reserve(pointValues.size());
+ const auto factor = QHighDpiScaling::factor(window);
for (const T &pointValue : pointValues)
- pixelValues.append(pointValue * QHighDpiScaling::factor(window));
+ pixelValues.append(pointValue * factor);
return pixelValues;
}