From 178ab885626bcd67507fde7f67f65c1872ac3be3 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 19 May 2016 18:06:59 +0200 Subject: 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 --- examples/widgets/painting/pathstroke/pathstroke.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') 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); -- cgit v1.2.3