File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -284,7 +284,7 @@ class BuildingShapeUtils extends ShapeUtils {
284284 var p0 ;
285285 var p1 ;
286286 var p2 ;
287- p0 = points [ points . length ] ;
287+ p0 = points [ points . length - 1 ] ;
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 ) ) ) ;
@@ -294,9 +294,9 @@ class BuildingShapeUtils extends ShapeUtils {
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 ) ) ) ;
296296 }
297- p0 = points [ points . length - 1 ] ;
298- p1 = points [ points . length ] ;
299- p2 = points [ 0 ] ;
297+ p0 = points [ 0 ] ;
298+ p1 = points [ points . length - 1 ] ;
299+ p2 = points [ points . length - 2 ] ;
300300 angles . push ( Math . atan ( ( p2 . y - p1 . y ) / ( p2 . x - p1 . x ) ) - Math . atan ( ( p0 . y - p1 . y ) / ( p0 . x - p1 . x ) ) ) ;
301301 return angles ;
302302 }
You can’t perform that action at this time.
0 commit comments