summaryrefslogtreecommitdiffstats
path: root/src/gui/math3d/qvector2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/math3d/qvector2d.cpp')
-rw-r--r--src/gui/math3d/qvector2d.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/math3d/qvector2d.cpp b/src/gui/math3d/qvector2d.cpp
index 2555a6f..a959979 100644
--- a/src/gui/math3d/qvector2d.cpp
+++ b/src/gui/math3d/qvector2d.cpp
@@ -216,9 +216,9 @@ void QVector2D::normalize()
return;
len = qSqrt(len);
-
- xp /= len;
- yp /= len;
+ const double inv_len = 1 / len;
+ xp *= inv_len;
+ yp *= inv_len;
}
/*!