Implement shift+click

This commit is contained in:
Daniel Imms
2017-06-06 14:19:12 -07:00
parent d3865ad23f
commit db8ded2a02
+16 -6
View File
@@ -238,12 +238,16 @@ export class SelectionManager extends EventEmitter {
this._setMouseClickCount();
console.log(this._clickCount);
if (this._clickCount === 1) {
this._onSingleClick(event);
} else if (this._clickCount === 2) {
this._onDoubleClick(event);
} else if (this._clickCount === 3) {
this._onTripleClick(event);
if (event.shiftKey) {
this._onShiftClick(event);
} else {
if (this._clickCount === 1) {
this._onSingleClick(event);
} else if (this._clickCount === 2) {
this._onDoubleClick(event);
} else if (this._clickCount === 3) {
this._onTripleClick(event);
}
}
// Listen on the document so that dragging outside of viewport works
@@ -253,6 +257,12 @@ export class SelectionManager extends EventEmitter {
this.refresh();
}
private _onShiftClick(event: MouseEvent): void {
if (this._model.selectionStart) {
this._model.selectionEnd = this._getMouseBufferCoords(event);
}
}
private _onSingleClick(event: MouseEvent): void {
this._model.selectionStartLength = 0;
this._model.isSelectAllActive = false;