Skip to content

Commit 84a0c07

Browse files
authored
Update BuildingShapeUtils.js
1 parent 6331350 commit 84a0c07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/extras/BuildingShapeUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ class BuildingShapeUtils extends ShapeUtils {
288288
p1 = points[0];
289289
p2 = points[1];
290290
angles.push(Math.atan((p2.y - p1.y) / (p2.x - p1.x)) - Math.atan((p0.y - p1.y) / (p0.x - p1.x)));
291-
for (let i = 1; i < points.length - 1; i++) {
292-
p0 = points[i-1];
291+
for (let i = 1; i < points.length - 2; i++) {
292+
p0 = points[i - 1];
293293
p1 = points[i];
294294
p2 = points[i + 1];
295295
angles.push(Math.atan((p2.y - p1.y) / (p2.x - p1.x)) - Math.atan((p0.y - p1.y) / (p0.x - p1.x)));

0 commit comments

Comments
 (0)