Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/xs
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2018-06-05 17:07:09 +0300
committerEnrico Turri <enricoturri@seznam.cz>2018-06-05 17:07:09 +0300
commit40bb0b6f55c5702da34b801eb23ee891a06c723d (patch)
tree7823da3a5240b5331b5d6ed85f956ee7ebcd28b5 /xs
parentfe3f5471e7df4dbb5f6ebe8953e463fffabe6321 (diff)
Fixed overflow in Polygon::area()
Diffstat (limited to 'xs')
-rw-r--r--xs/src/libslic3r/Polygon.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/xs/src/libslic3r/Polygon.cpp b/xs/src/libslic3r/Polygon.cpp
index 27f9a2ca1..b5fd7e64f 100644
--- a/xs/src/libslic3r/Polygon.cpp
+++ b/xs/src/libslic3r/Polygon.cpp
@@ -103,7 +103,7 @@ double Polygon::area() const
double a = 0.;
for (size_t i = 0, j = n - 1; i < n; ++i) {
- a += double(points[j].x + points[i].x) * double(points[i].y - points[j].y);
+ a += ((double)points[j].x + (double)points[i].x) * ((double)points[i].y - (double)points[j].y);
j = i;
}
return 0.5 * a;