diff --git a/src/Add-on/Stretch.ts b/src/Add-on/Stretch.ts index b4e893792..4b0149955 100644 --- a/src/Add-on/Stretch.ts +++ b/src/Add-on/Stretch.ts @@ -32,6 +32,7 @@ export class Stretch implements Command app.m_Editor.AddNoSnapEntity(e); let lastP = p1.Value.clone(); + let curP = lastP.clone(); let p2 = await app.m_Editor.GetPoint( { BasePoint: p1.Value, @@ -40,9 +41,18 @@ export class Stretch implements Command { let v = p.clone().sub(lastP); this.s(data, v); + curP.copy(p); } }); + if (p2.Status === PromptStatus.OK) + this.s(data, p2.Value.sub(lastP)); + else + { + data.moveEntityList.forEach(e => this.RestoreEntity(e)); + data.stretchEntityMap.forEach((v, k) => this.RestoreEntity(k)); + } + app.m_Editor.ClearSnapEntity(); app.m_Editor.m_SelectCtrl.Cancel(); if (p1.Status != PromptStatus.OK) return; @@ -53,10 +63,10 @@ export class Stretch implements Command parse(ss: SelectSet): StretchData { let data: StretchData = - { - stretchEntityMap: new Map>(), - moveEntityList: [] - }; + { + stretchEntityMap: new Map>(), + moveEntityList: [] + }; for (let set of ss.SelectSetList) { if (set instanceof SelectPick)