summaryrefslogtreecommitdiffstats
path: root/src/core/render_widget_host_view_qt.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-04-16 13:06:58 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2020-04-16 14:43:59 +0200
commit270ecb76d378b1cf8a5db63b100f6ddafdd796ef (patch)
treeae95217466cf280441895743d0a8ab64f0225f73 /src/core/render_widget_host_view_qt.cpp
parenteb96f424587c5da4eabe1306e4c277879a245c02 (diff)
Replace deprecated call to TouchPoint::rect() with ellipseDiameters()
GetTouchMajor/Minor sound like they are intended to return ellipse diameters, so it was clearly the right thing to do already, any time after 5.6 when rect() was deprecated. Change-Id: I3cbb1e9f38206626fdd9fe2eb3d799662751c475 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/render_widget_host_view_qt.cpp')
-rw-r--r--src/core/render_widget_host_view_qt.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 813ce4be9..5887b356e 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -1,3 +1,4 @@
+
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
@@ -216,13 +217,13 @@ public:
float GetRawY(size_t pointer_index) const override { return touchPoints.at(pointer_index).screenPos().y(); }
float GetTouchMajor(size_t pointer_index) const override
{
- QRectF touchRect = touchPoints.at(pointer_index).rect();
- return std::max(touchRect.height(), touchRect.width());
+ QSizeF diams = touchPoints.at(pointer_index).ellipseDiameters();
+ return std::max(diams.height(), diams.width());
}
float GetTouchMinor(size_t pointer_index) const override
{
- QRectF touchRect = touchPoints.at(pointer_index).rect();
- return std::min(touchRect.height(), touchRect.width());
+ QSizeF diams = touchPoints.at(pointer_index).ellipseDiameters();
+ return std::min(diams.height(), diams.width());
}
float GetOrientation(size_t pointer_index) const override
{