From a55c2d776842bfc09f2796bfcc0f9b5183e98d86 Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Sun, 25 Dec 2016 03:03:29 -0800 Subject: [PATCH] deselectAll on craft event --- web/app/3d/selection.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/app/3d/selection.js b/web/app/3d/selection.js index 895269a0..9260a81e 100644 --- a/web/app/3d/selection.js +++ b/web/app/3d/selection.js @@ -5,6 +5,7 @@ class AbstractSelectionManager { constructor(viewer) { this.viewer = viewer; this.selection = []; + this.viewer.bus.subscribe('craft', () => this.deselectAll()); } contains(face) { @@ -22,6 +23,10 @@ class AbstractSelectionManager { select() { throw "AbstractFunctionCall"; } + + deselectAll() { + throw "AbstractFunctionCall"; + } } export class SketchSelectionManager extends AbstractSelectionManager { @@ -40,6 +45,10 @@ export class SketchSelectionManager extends AbstractSelectionManager { this.notify(); this.viewer.render(); } + + deselectAll() { + this.clear(); + } clear() { this._clearSilent();