修复捕捉基点被丢弃

pull/439/head
ChenX 5 years ago
parent eb1d06cb6f
commit 0a8c663d2d

@ -274,15 +274,21 @@ export class SnapServices
() =>
{
let fIndex = this.m_SupportSnapPoints.findIndex(p => equalv3(p.Point, snapData.Point));
if (fIndex > 0)//基点不移除
if (fIndex !== -1)
{
this.m_SupportSnapPoints.splice(fIndex, 1);
if (!(fIndex === 0 && this.m_HasBasePoint))//基点不移除
this.m_SupportSnapPoints.splice(fIndex, 1);
}
else
{
this.m_SupportSnapPoints.push(snapData);
if (this.m_SupportSnapPoints.length > 7)
this.m_SupportSnapPoints.shift();
{
if (this.m_HasBasePoint)
this.m_SupportSnapPoints.splice(1, 1);
else
this.m_SupportSnapPoints.shift();
}
}
this.UpdateCrossCursor();
},

Loading…
Cancel
Save