From 201f89f463ae82fe8e9239d7312907062e9a8d15 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 6 Dec 2016 14:48:44 +0100 Subject: QTouchEvent::TouchPoint: replace ellipse diameters with QSizeF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It makes assignment a bit more succinct and efficient since they are usually set together. Since we store the diameters and the points separately, we no longer need to worry about updating rects by moving their centers. QGuiApplication and QApplication don't need to alter the diameters: they are set once when the event is constructed. Also fix the initialization of pressure and rotation: 418b6f6899ee414aff29c91a4ae17eed8791a617 did it by casting a double to qreal, whereas a plain integer constant will be auto-converted by the compiler anyway. Change-Id: Ib9956d2def21278b8ae042147d917da156e77e52 Reviewed-by: Jan Arve Sæther --- src/gui/kernel/qevent_p.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/gui/kernel/qevent_p.h') diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h index a8b4d520d4..f67284eebb 100644 --- a/src/gui/kernel/qevent_p.h +++ b/src/gui/kernel/qevent_p.h @@ -65,10 +65,9 @@ public: : ref(1), id(id), state(Qt::TouchPointReleased), - pressure(qreal(-1.)), - rotation(qreal(0.)), - verticalDiameter(0), - horizontalDiameter(0) + pressure(-1), + rotation(0), + ellipseDiameters(0, 0) { } inline QTouchEventTouchPointPrivate *detach() @@ -89,8 +88,7 @@ public: lastPos, lastScenePos, lastScreenPos, lastNormalizedPos; qreal pressure; qreal rotation; - qreal verticalDiameter; - qreal horizontalDiameter; + QSizeF ellipseDiameters; QVector2D velocity; QTouchEvent::TouchPoint::InfoFlags flags; QVector rawScreenPositions; -- cgit v1.2.3