From 99bb6bb98302c42edbd2b7422da15e7964422eb8 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 May 2015 15:51:44 +0300 Subject: [PATCH] Refactoring. --HG-- branch : feature --- src/libs/vgeometry/vgobject.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/vgeometry/vgobject.cpp b/src/libs/vgeometry/vgobject.cpp index d2ca296c1..6046fe5bf 100644 --- a/src/libs/vgeometry/vgobject.cpp +++ b/src/libs/vgeometry/vgobject.cpp @@ -289,10 +289,10 @@ qint32 VGObject::LineIntersectCircle(const QPointF ¢er, qreal radius, const qreal a = 0, b = 0, c = 0; LineCoefficients(line, &a, &b, &c); // projection center of circle on to line - QPointF p = ClosestPoint (line, center); + const QPointF p = ClosestPoint (line, center); // how many solutions? qint32 flag = 0; - qreal d = QLineF (center, p).length(); + const qreal d = QLineF (center, p).length(); if (qFuzzyCompare(d, radius)) { flag = 1; @@ -309,8 +309,8 @@ qint32 VGObject::LineIntersectCircle(const QPointF ¢er, qreal radius, const } } // find distance from projection to points of intersection - qreal k = qSqrt (qAbs(radius * radius - d * d)); - qreal t = QLineF (QPointF (0, 0), QPointF (b, - a)).length(); + const qreal k = qSqrt (qAbs(radius * radius - d * d)); + const qreal t = QLineF (QPointF (0, 0), QPointF (b, - a)).length(); // add to projection a vectors aimed to points of intersection p1 = addVector (p, QPointF (0, 0), QPointF (- b, a), k / t); p2 = addVector (p, QPointF (0, 0), QPointF (b, - a), k / t);