|
@@ -101,13 +101,19 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
|
|
|
_mouseDownFlag = "";
|
|
|
_mouseDownTimestamp = 0;
|
|
|
|
|
|
+ _containers:Map<string, ObjsContainer> = new Map();
|
|
|
+
|
|
|
_updateSelects() {
|
|
|
const selecteds = this.store.selected;
|
|
|
+ const ObjC = this._containers.get(this.store.selectId)
|
|
|
let objs = [];
|
|
|
for (let item of selecteds) {
|
|
|
objs.push( new CompObject(this.compMap[item]) )
|
|
|
}
|
|
|
- this.selecteObjs(objs);
|
|
|
+ this.selecteObjs(objs, ObjC);
|
|
|
+ if (this.store.selectId) {
|
|
|
+ this._containers.set(this.store.selectId, this.objContainer as ObjsContainer);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
onDocMouseDown(e: MouseEvent) {
|
|
@@ -294,6 +300,7 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
|
|
|
movingMousemove(e: MouseEvent) {
|
|
|
const objContainer = this.objContainer as ObjsContainer;
|
|
|
|
|
|
+ objContainer.setPivot(0);
|
|
|
objContainer.translate(
|
|
|
e.clientX - this._movePreClientX,
|
|
|
e.clientY - this._movePreClientY
|
|
@@ -396,6 +403,7 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
|
|
|
this._selCanvaseSize.h
|
|
|
);
|
|
|
this.upgateGizmoStyle();
|
|
|
+ this.helper.extendStreamCard(this.store.currStreamCardId);
|
|
|
}
|
|
|
moveMouseUp(e: MouseEvent) {
|
|
|
const history = this.controls.historyCtrl.history;
|
|
@@ -407,24 +415,31 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
|
|
|
const initX = this._initMovePos.x,
|
|
|
initY = this._initMovePos.y;
|
|
|
|
|
|
+ obj.setPivot(0);
|
|
|
+
|
|
|
history.record({
|
|
|
undo: () => {
|
|
|
console.log("undo ");
|
|
|
-
|
|
|
const currObj = this.objContainer as ObjsContainer;
|
|
|
+ currObj.setPivot(0);
|
|
|
currObj.parent.x = initX;
|
|
|
currObj.parent.y = initY;
|
|
|
currObj.parent.updateTransform();
|
|
|
currObj.updateCompState();
|
|
|
+
|
|
|
this.upgateGizmoStyle();
|
|
|
+ this.helper.extendStreamCard(this.store.currStreamCardId);
|
|
|
},
|
|
|
redo: () => {
|
|
|
+
|
|
|
const currObj = this.objContainer as ObjsContainer;
|
|
|
+ currObj.setPivot(0);
|
|
|
currObj.parent.x = lastX;
|
|
|
currObj.parent.y = lastY;
|
|
|
currObj.parent.updateTransform();
|
|
|
currObj.updateCompState();
|
|
|
this.upgateGizmoStyle();
|
|
|
+ this.helper.extendStreamCard(this.store.currStreamCardId);
|
|
|
},
|
|
|
} as any);
|
|
|
history.submit();
|
|
@@ -446,7 +461,6 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
|
|
|
}
|
|
|
|
|
|
upgateGizmoStyle() {
|
|
|
- this.helper.extendStreamCard(this.store.currStreamCardId);
|
|
|
this.transferStyle.mode = this._state;
|
|
|
|
|
|
if (this.selected.length < 1) {
|
|
@@ -675,18 +689,30 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
|
|
|
let initrad = scope.objinitAngleRad;
|
|
|
|
|
|
const history = this.controls.historyCtrl.history;
|
|
|
+ this.objContainer?.setPivot(0);
|
|
|
+
|
|
|
history.record({
|
|
|
undo: () => {
|
|
|
- console.log("undo ");
|
|
|
+
|
|
|
+ const objContainer = this.objContainer as ObjsContainer;
|
|
|
+
|
|
|
this.objContainer?.setPivot(4);
|
|
|
this.objContainer?.rotate(initrad);
|
|
|
+ this.objContainer?.setPivot(0);
|
|
|
+ this.objContainer?.updateCompState();
|
|
|
this.upgateGizmoStyle();
|
|
|
+ this.helper.extendStreamCard(this.store.currStreamCardId);
|
|
|
},
|
|
|
+
|
|
|
redo: () => {
|
|
|
console.log("redo ");
|
|
|
+ const objContainer = this.objContainer as ObjsContainer;
|
|
|
this.objContainer?.setPivot(4);
|
|
|
this.objContainer?.rotate(last);
|
|
|
+ this.objContainer?.setPivot(0);
|
|
|
+ this.objContainer?.updateCompState();
|
|
|
this.upgateGizmoStyle();
|
|
|
+ this.helper.extendStreamCard(this.store.currStreamCardId);
|
|
|
},
|
|
|
} as any);
|
|
|
history.submit();
|
|
@@ -802,6 +828,7 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
|
|
|
let lastScale = { x: this.lastScale.x, y: this.lastScale.y };
|
|
|
|
|
|
const history = this.controls.historyCtrl.history;
|
|
|
+ this.objContainer?.setPivot(0);
|
|
|
|
|
|
history.record({
|
|
|
undo: () => {
|
|
@@ -809,13 +836,20 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
|
|
|
|
|
|
this.objContainer?.setPivot(scaleIndex);
|
|
|
this.objContainer?.scaleSize(preScale.x, preScale.y);
|
|
|
+ this.objContainer?.setPivot(0);
|
|
|
+ this.objContainer?.updateCompState();
|
|
|
+
|
|
|
this.upgateGizmoStyle();
|
|
|
+ this.helper.extendStreamCard(this.store.currStreamCardId);
|
|
|
},
|
|
|
redo: () => {
|
|
|
console.log("redo ");
|
|
|
this.objContainer?.setPivot(scaleIndex);
|
|
|
this.objContainer?.scaleSize(lastScale.x, lastScale.y);
|
|
|
+ this.objContainer?.setPivot(0);
|
|
|
+ this.objContainer?.updateCompState();
|
|
|
this.upgateGizmoStyle();
|
|
|
+ this.helper.extendStreamCard(this.store.currStreamCardId);
|
|
|
},
|
|
|
} as any);
|
|
|
history.submit();
|