liwei 1 year ago
parent
commit
a462389a3a

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

@@ -212,8 +212,8 @@ const borderContentStyle = css`
 
 const resizeStyle = css`
   position: absolute;
-  width: 16px;
-  height: 16px;
+  width: 10px;
+  height: 10px;
   border-radius: 50%;
   background-color: #fff;
   z-index: 999;

+ 13 - 4
src/modules/editor/module/actions/edit.tsx

@@ -322,11 +322,21 @@ export const editActions = EditorModule.action({
   },
 
   setSameSize(isWidth:boolean) {
+   
+    const selectCtrl = this.controls.selectCtrl;
+    const objc = selectCtrl.objContainer as ObjsContainer;
+    if (this.store.selected.length == 1 ) {
+      this.store.currComp.layout.size[0] = 750;
+      objc.updateSize();
+  
+      selectCtrl.upgateGizmoStyle();
+      return;
+    }
+
     const anchorBox = this.helper.findComp(this.store.lastSelected);
     if (!anchorBox) return;
 
-    const selectCtrl = this.controls.selectCtrl;
-    const objc = selectCtrl.objContainer as ObjsContainer;
+ 
    
     objc.parent.children.forEach((c)=>{
       const child = c as CompObject;
@@ -336,9 +346,8 @@ export const editActions = EditorModule.action({
     })
 
     objc.updateSize();
-
-    selectCtrl.upgateGizmoStyle();
     
+    selectCtrl.upgateGizmoStyle();
   },
 
   toogleGroup() {

+ 1 - 1
src/modules/editor/objects/Toolbars/layout.ts

@@ -75,7 +75,7 @@ export const LayoutToolbars = createToolbars({
     },
     SameWidth: {
         component: TipIcons.SameWidth,
-        getVisible(comp) { return this.store.selected.length > 1 && !!this.store.lastSelected },
+        getVisible(comp) { return this.store.selected.length > 0 },
         onClick(comp) {
             this.actions.setSameSize(true);
         },