summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbscreen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbscreen.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index 63e4d9e75b..040cea1cb2 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -282,6 +282,18 @@ QPoint QXcbScreen::mapFromNative(const QPoint &pos) const
return (pos - m_nativeGeometry.topLeft()) / dpr + m_geometry.topLeft();
}
+QPointF QXcbScreen::mapToNative(const QPointF &pos) const
+{
+ const int dpr = int(devicePixelRatio());
+ return (pos - m_geometry.topLeft()) * dpr + m_nativeGeometry.topLeft();
+}
+
+QPointF QXcbScreen::mapFromNative(const QPointF &pos) const
+{
+ const int dpr = int(devicePixelRatio());
+ return (pos - m_nativeGeometry.topLeft()) / dpr + m_geometry.topLeft();
+}
+
QRect QXcbScreen::mapToNative(const QRect &rect) const
{
const int dpr = int(devicePixelRatio());