diff options
Diffstat (limited to 'examples/widgets/painting/affine/xform.cpp')
-rw-r--r-- | examples/widgets/painting/affine/xform.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/examples/widgets/painting/affine/xform.cpp b/examples/widgets/painting/affine/xform.cpp index dc01acf453..50acf0f814 100644 --- a/examples/widgets/painting/affine/xform.cpp +++ b/examples/widgets/painting/affine/xform.cpp @@ -160,10 +160,7 @@ void XFormView::updateCtrlPoints(const QPolygonF &points) ctrlPoints = points; QLineF line(ctrlPoints.at(0), ctrlPoints.at(1)); - m_rotation = line.angle(QLineF(0, 0, 1, 0)); - if (line.dy() < 0) - m_rotation = 360 - m_rotation; - + m_rotation = 360 - QLineF(0, 0, 1, 0).angleTo(line); if (trans.isNull()) emit rotationChanged(int(m_rotation*10)); } @@ -263,7 +260,7 @@ void XFormView::timerEvent(QTimerEvent *e) #if QT_CONFIG(wheelevent) void XFormView::wheelEvent(QWheelEvent *e) { - m_scale += e->delta() / qreal(600); + m_scale += e->angleDelta().y() / qreal(600); m_scale = qMax(qreal(0.1), qMin(qreal(4), m_scale)); emit scaleChanged(int(m_scale*1000)); } |