mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 10:47:50 -06:00
Fixed overflow in Polygon::area()
This commit is contained in:
parent
fe3f5471e7
commit
40bb0b6f55
1 changed files with 1 additions and 1 deletions
|
@ -103,7 +103,7 @@ double Polygon::area() const
|
||||||
|
|
||||||
double a = 0.;
|
double a = 0.;
|
||||||
for (size_t i = 0, j = n - 1; i < n; ++i) {
|
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;
|
j = i;
|
||||||
}
|
}
|
||||||
return 0.5 * a;
|
return 0.5 * a;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue