deselectAll on craft event

This commit is contained in:
Val Erastov 2016-12-25 03:03:29 -08:00
parent ac7f52325f
commit a55c2d7768

View file

@ -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();