liwei 1 жил өмнө
parent
commit
3b265e84cd

+ 3 - 0
src/modules/editor/components/CompUI/basicUI/Transfer/select.tsx

@@ -25,6 +25,7 @@ export const SelectTransfer = defineComponent({
 
     const scaleTopRef = ref();
     const scaleBottomRef = ref();
+    const toolbarRef = ref();
 
     onMounted(() => {
       nextTick(() => {
@@ -37,6 +38,7 @@ export const SelectTransfer = defineComponent({
         scaleBottomLeftRef.value.editable = "scaleBottomleft";
         scaleTopLeftRef.value.editable = "scaleTopleft";
         scaleTopRightRef.value.editable = "scaleTopright";
+        toolbarRef.value.editable = "toolbar"
       });
     });
 
@@ -70,6 +72,7 @@ export const SelectTransfer = defineComponent({
           }}
         >
           <div
+            ref={toolbarRef}
             class={toolbarStyle}
             style={{
               top: w?.y + "px",

+ 5 - 1
src/modules/editor/controllers/SelectCtrl/index.ts

@@ -309,6 +309,10 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
   }
 
   onDocMouseUp(e: MouseEvent) {
+    if (this._mouseDownFlag == "toolbar") {
+      return;
+    }
+
     let isClick = false;
     let offsetT = Date.now() - this._mouseDownTimestamp;
 
@@ -383,7 +387,7 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
   upgateGizmoStyle() {
     this.helper.extendStreamCard(this.store.currStreamCardId);
     this.transferStyle.mode = this._state;
-    
+
     if (this.selected.length < 1) {
       this.transferStyle.showGizmo = false;
       return;

+ 7 - 2
src/modules/editor/module/actions/edit.ts

@@ -127,11 +127,16 @@ export const editActions = EditorModule.action({
   removeComp(compId: string) {
 
     if (this.helper.isCompCanDelete(compId)) {
+
+      const cardid = this.store.currStreamCardId
       if (compId === this.store.currCompId) { 
-        this.store.setCurrComp("root");
+        this.store.setCurrComp(this.store.currStreamCardId);
       }
-      this.controls.selectCtrl.selecteObjs([]);
       this.store.deleteComp(compId);
+
+      this.helper.extendStreamCard(cardid);
+      
+      this.controls.selectCtrl.selecteObjs([]);
     }
   },
 

+ 5 - 3
src/modules/editor/module/helpers/index.ts

@@ -136,7 +136,7 @@ export const helpers = EditorModule.helper({
 
   extendStreamCard(streamCardId: string) {
     if (!streamCardId) return;
-    
+
     const compMap = this.store.designData.compMap;
     const card = compMap[streamCardId];
     const childs = card.children.default || [];
@@ -148,8 +148,10 @@ export const helpers = EditorModule.helper({
       maxH = Math.max(maxH, aabb.y + aabb.h);
     }
     maxH = this.helper.pxToDesignSize(maxH);
+
+    if (childs.length < 1 ) {
+      maxH = 200
+    }
     card.setH(maxH);
   },
-
-
 });