From 0c019f44507446763c48cdc1ccbf964c7c14fe37 Mon Sep 17 00:00:00 2001 From: ChenX Date: Mon, 15 Jan 2018 11:15:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Editor/GetPointServices.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Editor/GetPointServices.ts b/src/Editor/GetPointServices.ts index a9dd41253..e02da325f 100644 --- a/src/Editor/GetPointServices.ts +++ b/src/Editor/GetPointServices.ts @@ -386,12 +386,7 @@ export class GetPointServices { axisIntersectList.sort((d1, d2) => { - let dis1 = d1.ins.distanceTo(wcs); - let dis2 = d2.ins.distanceTo(wcs); - if (dis1 == dis2) - return 0; - else - return dis1 < dis2 ? -1 : 1 + return d1.ins.distanceTo(wcs) < d2.ins.distanceTo(wcs) ? -1 : 1 }); let insD = axisIntersectList[0]; @@ -407,10 +402,11 @@ export class GetPointServices snapAxisList.sort((d1, d2) => { return d1.snapPt.distanceTo(wcs) < d2.snapPt.distanceTo(wcs) ? -1 : 1 - }) + }); - this.DrawLine(snapAxisList[0].basePt, snapAxisList[0].snapPt, preView.m_BlueDashMaterial); - return snapAxisList[0].snapPt; + let snapAxis = snapAxisList[0]; + this.DrawLine(snapAxis.basePt, snapAxis.snapPt, preView.m_BlueDashMaterial); + return snapAxis.snapPt; } }