diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2017-02-24 16:11:41 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2017-02-27 12:05:01 +0000 |
commit | 672c14bb3b462f31e1d9fc7918eb9666fc16a260 (patch) | |
tree | 94b9bef4339f3cdcce2f8837cb5ce79de8cdef6a /src/shared | |
parent | 7476e2b184d4a7938dc34780952eee8a5ebe66b7 (diff) |
Rename a variable sanity-bot mistook for a typo
It was called "ang", short for "angle", and sanity-bot thought it was
a typo of "and". It's not an angle; it's actually a ray, so call it
that. Also, make it const, since it's never changed once set.
Change-Id: I6fdba2997b62654ebdd6c56e9aaea230a8cd740d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/qtgradienteditor/qtgradientwidget.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/shared/qtgradienteditor/qtgradientwidget.cpp b/src/shared/qtgradienteditor/qtgradientwidget.cpp index 29d5c730e..36b994dde 100644 --- a/src/shared/qtgradienteditor/qtgradientwidget.cpp +++ b/src/shared/qtgradienteditor/qtgradientwidget.cpp @@ -619,28 +619,28 @@ void QtGradientWidget::paintEvent(QPaintEvent *e) p.setBrush(Qt::NoBrush); int pointCount = 2; for (int i = 0; i < pointCount; i++) { - QPointF ang(cos(M_PI * (i * 180.0 / pointCount + d_ptr->m_angleConical) / 180) * size().width() / 2, + const QPointF ray(cos(M_PI * (i * 180.0 / pointCount + d_ptr->m_angleConical) / 180) * size().width() / 2, -sin(M_PI * (i * 180.0 / pointCount + d_ptr->m_angleConical) / 180) * size().height() / 2); const double mod = hypot(ray.x(), ray.y()); - p.drawLine(QPointF(central.x() + ang.x() * (radius - corr) / mod, - central.y() + ang.y() * (radius - corr) / mod), - QPointF(central.x() + ang.x() * (radius + corr) / mod, - central.y() + ang.y() * (radius + corr) / mod)); - p.drawLine(QPointF(central.x() - ang.x() * (radius - corr) / mod, - central.y() - ang.y() * (radius - corr) / mod), - QPointF(central.x() - ang.x() * (radius + corr) / mod, - central.y() - ang.y() * (radius + corr) / mod)); + p.drawLine(QPointF(central.x() + ray.x() * (radius - corr) / mod, + central.y() + ray.y() * (radius - corr) / mod), + QPointF(central.x() + ray.x() * (radius + corr) / mod, + central.y() + ray.y() * (radius + corr) / mod)); + p.drawLine(QPointF(central.x() - ray.x() * (radius - corr) / mod, + central.y() - ray.y() * (radius - corr) / mod), + QPointF(central.x() - ray.x() * (radius + corr) / mod, + central.y() - ray.y() * (radius + corr) / mod)); } if (d_ptr->m_dragHandle == QtGradientWidgetPrivate::AngleConicalHandle) { p.save(); p.setPen(dragPen); - QPointF ang(cos(M_PI * (d_ptr->m_angleConical - d_ptr->m_angleOffset) / 180) * size().width() / 2, + const QPointF ray(cos(M_PI * (d_ptr->m_angleConical - d_ptr->m_angleOffset) / 180) * size().width() / 2, -sin(M_PI * (d_ptr->m_angleConical - d_ptr->m_angleOffset) / 180) * size().height() / 2); const double mod = hypot(ray.x(), ray.y()); - p.drawLine(QPointF(central.x() + ang.x() * (radius - corr) / mod, - central.y() + ang.y() * (radius - corr) / mod), - QPointF(central.x() + ang.x() * (radius + corr) / mod, - central.y() + ang.y() * (radius + corr) / mod)); + p.drawLine(QPointF(central.x() + ray.x() * (radius - corr) / mod, + central.y() + ray.y() * (radius - corr) / mod), + QPointF(central.x() + ray.x() * (radius + corr) / mod, + central.y() + ray.y() * (radius + corr) / mod)); p.restore(); } |