From 0a8c663d2dbb51269539309852438ed17ce0e710 Mon Sep 17 00:00:00 2001 From: ChenX Date: Wed, 31 Jul 2019 14:46:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8D=95=E6=8D=89=E5=9F=BA?= =?UTF-8?q?=E7=82=B9=E8=A2=AB=E4=B8=A2=E5=BC=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Editor/SnapServices.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Editor/SnapServices.ts b/src/Editor/SnapServices.ts index d53ca32e9..a8c54b717 100644 --- a/src/Editor/SnapServices.ts +++ b/src/Editor/SnapServices.ts @@ -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(); },