diff options
author | Edward Welbourne <edward.welbourne@theqtcompany.com> | 2016-05-19 18:06:59 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2016-07-15 11:35:12 +0000 |
commit | 178ab885626bcd67507fde7f67f65c1872ac3be3 (patch) | |
tree | e3ec46fa4320bb13918825363bdcd6fafe2cf24e /examples/widgets/painting | |
parent | 89765ced6e9ce7e20aa1090439869509f86a070a (diff) |
PathStrokeRenderer::initializePoints(): use float division
The (example) code used a real to hold 360 / 7, which is of course 51,
discarding the 3/7 that was most likely meant to be kept. Noticed by
Coverity (CID 22364). Use 360.0 instead of 360 to get more accurate
results.
Change-Id: Ifdfbb932589d8ea728710e8b656af651c9f8a7d2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'examples/widgets/painting')
-rw-r--r-- | examples/widgets/painting/pathstroke/pathstroke.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/widgets/painting/pathstroke/pathstroke.cpp b/examples/widgets/painting/pathstroke/pathstroke.cpp index d93dcfe386..db3c6f946b 100644 --- a/examples/widgets/painting/pathstroke/pathstroke.cpp +++ b/examples/widgets/painting/pathstroke/pathstroke.cpp @@ -477,7 +477,7 @@ void PathStrokeRenderer::initializePoints() m_vectors.clear(); QMatrix m; - qreal rot = 360 / count; + qreal rot = 360.0 / count; QPointF center(width() / 2, height() / 2); QMatrix vm; vm.shear(2, -1); |