修复intervalDistance计算错误问题

This commit is contained in:
yhh
2020-12-04 14:42:29 +08:00
parent 9654a4d8c9
commit c2cd3b9c44
5 changed files with 17 additions and 21 deletions

View File

@@ -13,9 +13,10 @@ module es {
// 第一点和最后一点决不能相同。我们想要一个开放的多边形
let isPolygonClosed = points[0] == points[points.length - 1];
let linqPoints = new linq.List(points);
// 最后一个移除
if (isPolygonClosed)
points.splice(points.length - 1, 1);
linqPoints.remove(linqPoints.last());
let center = Polygon.findPolygonCenter(points);
this.setLocalOffset(center);