|
@@ -80,9 +80,9 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
|
|
|
this._selCanvaseSize.w = selCanvas.width * 2;
|
|
|
this._selCanvaseSize.h = selCanvas.height * 2;
|
|
|
|
|
|
- document.addEventListener("mousedown", this.onDocMouseDown.bind(this), {capture: true});
|
|
|
- document.addEventListener("mousemove", this.onDocMouseMove.bind(this), {capture: true});
|
|
|
- document.addEventListener("mouseup", this.onDocMouseUp.bind(this), {capture: true});
|
|
|
+ viewport.addEventListener("mousedown", this.onDocMouseDown.bind(this), {capture: true});
|
|
|
+ viewport.addEventListener("mousemove", this.onDocMouseMove.bind(this), {capture: true});
|
|
|
+ viewport.addEventListener("mouseup", this.onDocMouseUp.bind(this), {capture: true});
|
|
|
|
|
|
window.addEventListener("resize", this.onResize.bind(this));
|
|
|
}
|
|
@@ -315,7 +315,6 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
|
|
|
|
|
|
let isClick = false;
|
|
|
let offsetT = Date.now() - this._mouseDownTimestamp;
|
|
|
-
|
|
|
const dx = Math.abs(e.clientX - this._downClientX);
|
|
|
const dy = Math.abs(e.clientY - this._downClientY);
|
|
|
if (dx < 2 && dy < 2 && !this.store.textEditingState && offsetT < 200) {
|
|
@@ -325,14 +324,9 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
|
|
|
this._state = MODE_NONE;
|
|
|
const comps = this.compClickTest(e);
|
|
|
if (comps.length < 1) {
|
|
|
- const card = this.streamCardClickTest(e);
|
|
|
- if (card) {
|
|
|
- this.actions.pickComp(card.id);
|
|
|
- }
|
|
|
- this.selecteObjs([]);
|
|
|
- } else {
|
|
|
- const objs = new CompObject(this.compMap[comps[0].id])
|
|
|
- this.selecteObjs([objs]);
|
|
|
+ setTimeout(() => {
|
|
|
+ this.selecteObjs([]);
|
|
|
+ }, 0);
|
|
|
}
|
|
|
}
|
|
|
console.log("up");
|
|
@@ -495,10 +489,6 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
|
|
|
)
|
|
|
return;
|
|
|
|
|
|
- if (objs.length == 1) {
|
|
|
- this.actions.pickComp(objs[0].comp.id);
|
|
|
- }
|
|
|
-
|
|
|
// objs = this.getSceneObjOrderArr(objs);
|
|
|
|
|
|
const preObjContainer = this.objContainer;
|