diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2016-04-21 08:43:54 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-04-21 07:32:55 +0000 |
commit | d07341340e7cee1e266254ec5e4bb38848e6a47f (patch) | |
tree | 484b9ac01022da359ab03aa79c5df49ce5ef3d31 /src/imports/controls/qquickdialring.cpp | |
parent | a3b57a000eb1ffd7038b8d92c062a32c254a4c9f (diff) |
Fix rendering of squished default Dial
Change-Id: Iffa49532b1137b89cf305fd5663658baa52bc13b
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/imports/controls/qquickdialring.cpp')
-rw-r--r-- | src/imports/controls/qquickdialring.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/imports/controls/qquickdialring.cpp b/src/imports/controls/qquickdialring.cpp index d2d5defd..77239a62 100644 --- a/src/imports/controls/qquickdialring.cpp +++ b/src/imports/controls/qquickdialring.cpp @@ -92,6 +92,7 @@ void QQuickDialRing::paint(QPainter *painter) const QRectF bounds = boundingRect(); const qreal smallest = qMin(bounds.width(), bounds.height()); QRectF rect = QRectF(pen.widthF() / 2.0 + 1, pen.widthF() / 2.0 + 1, smallest - pen.widthF() - 2, smallest - pen.widthF() - 2); + rect.moveCenter(bounds.center()); // Make sure the arc is aligned to whole pixels. if (rect.x() - int(rect.x()) > 0) @@ -112,10 +113,10 @@ void QQuickDialRing::paint(QPainter *painter) path.arcTo(rect, startAngle, spanAngle); painter->drawPath(path); + rect.adjust(-pen.widthF() / 2.0, -pen.widthF() / 2.0, pen.widthF() / 2.0, pen.widthF() / 2.0); pen.setWidth(1); painter->setPen(pen); - rect = QRectF(1, 1, width() - 2, height() - 2); path = QPainterPath(); path.arcMoveTo(rect, 0); path.arcTo(rect, 0, 360); |