对于空的pts 数组也支持

This commit is contained in:
ChenX
2018-05-29 09:26:01 +08:00
parent 3b032dfcad
commit 10cc259261
3 changed files with 3 additions and 3 deletions

2
dist/createBoard.js vendored
View File

@@ -80,7 +80,7 @@ function createBoard(boardData) {
boardMat.setPosition(pBase); boardMat.setPosition(pBase);
matInv.getInverse(boardMat, true); matInv.getInverse(boardMat, true);
} }
if (boardPts) if (boardPts || boardPts.length === 0)
for (let i = 0; i < boardPts.length; i++) { for (let i = 0; i < boardPts.length; i++) {
let pt = getVec(boardPts[i]); let pt = getVec(boardPts[i]);
if (pt.z !== undefined) if (pt.z !== undefined)

File diff suppressed because one or more lines are too long

View File

@@ -101,7 +101,7 @@ export function createBoard(boardData: object)
matInv.getInverse(boardMat, true); matInv.getInverse(boardMat, true);
} }
if (boardPts) if (boardPts || boardPts.length === 0)
for (let i = 0; i < boardPts.length; i++) for (let i = 0; i < boardPts.length; i++)
{ {
let pt = getVec(boardPts[i]); let pt = getVec(boardPts[i]);