当我使用 splice 函数时,它会插入点,但会复制数组最后一个元素的副本。
for(indexpoint=0;indexpoint<intpoints.length;indexpoint++)
{
temp.points[indexpoint].x = intpoints[indexpoint].x+this.x;
temp.points[indexpoint].y = intpoints[indexpoint].y+this.y;
}
const point:Point = new Point();
point.x = (intpoints[2].x+intpoints[3].x)/2+this.x;
point.y = (intpoints[2].y+intpoints[3].y)/2+this.y;
temp.points.splice(3,0, point);