!1260 修复:编辑层板钉数量

pull/1260/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent 400224c2c6
commit d7349c96c8

@ -285,7 +285,7 @@ class ActivityLayerBoardTool
{ {
let nId: ObjectId; let nId: ObjectId;
let otherBoard = brNailMap.get(nails[i]); let otherBoard = brNailMap.get(nails[i]);
if (i < oldNailIds.length) if (i < oldNailIds.length && oldNailIds[i])
{ {
let nail = oldNailIds[i].Object as CylinderHole; let nail = oldNailIds[i].Object as CylinderHole;
if (nail.IsErase) if (nail.IsErase)
@ -296,6 +296,12 @@ class ActivityLayerBoardTool
nail.Height = nails[i].Height; nail.Height = nails[i].Height;
nail.Position = nails[i].Position; nail.Position = nails[i].Position;
nId = nail.Id; nId = nail.Id;
if (nail.FId !== otherBoard.Id)
{
nail.FId = otherBoard.Id;
otherBoard.AppendNails([nId]);
}
} }
else else
{ {
@ -347,6 +353,8 @@ class ActivityLayerBoardTool
} }
if (j < oldNails.length) if (j < oldNails.length)
temp.push(...oldNails.splice(j, 1)); temp.push(...oldNails.splice(j, 1));
else
temp.push(undefined); //不存在可以复用的层板钉,占个位 重新添加
} }
oldNails.unshift(...temp); oldNails.unshift(...temp);
} }

Loading…
Cancel
Save