qinyan hai 1 ano
pai
achega
d58197659d

+ 1 - 1
src/modules/editor/components/CompUI/basicUI/Text/TextToolForm.tsx

@@ -79,7 +79,7 @@ export const TextToolForm = defineComponent({
                   dataIndex: "fontFamily",
                   component: FontFamily,
                   props: {
-                    class: "w-190px",
+                    class: "w-170px",
                   },
                 }}
                 onChange={changeVal}

+ 2 - 0
src/modules/editor/controllers/HotKeyCtrl/index.ts

@@ -100,6 +100,8 @@ export class HotKeyCtrl extends ModuleControl<EditorModule> {
       if (event.ctrlKey && event.key === 'a') {
         event.preventDefault();
         event.stopPropagation();
+        // 文字编辑状态,不做操作
+        if(this.controls.textEditorCtrl.state.currEditor) return
         this.actions.ctrlAndA();
       }
     });

+ 15 - 2
src/modules/editor/controllers/SelectCtrl/gizemo.ts

@@ -8,7 +8,7 @@ import { RxValue } from '../ReactCtrl/rxValue';
 import { DesignComp } from '../../objects/DesignTemp/DesignComp';
 import { Transform } from './objects/transform';
 import { history } from '../../objects/DesignTemp/factory';
-import { designSizeToPx } from '../../module/utils';
+import { designSizeToPx, pxToDesignSize } from '../../module/utils';
 
 type FnGetCompObj = (id:string)=>DesignComp;
 
@@ -155,7 +155,20 @@ export class Gizemo extends Events {
           
           console.log("mouse=>", this.state.mouse);
           if ( (this.state.mouse == "scaleright" || this.state.mouse == "scaleleft") && this.selected.length == 1 ) {
-             console.log("text width changing....")
+              const child = this.selected[0];
+              if (child.comp.compKey =='Text'){
+                  const element: HTMLElement | null = document.querySelector(`#editor_${child.comp.id}`);
+                  if (!element) {
+                      return;
+                    }
+                    const h = pxToDesignSize(element.clientHeight);
+                    const layoutSize = child.comp.layout.size.slice(0);
+                    // @ts-ignore
+                    // child.setHeight(h)
+                    child.comp.layout.setSize([layoutSize[0],h]);
+                    this.rect.height = element.clientHeight;
+                
+             }
           }
 
           this.updateCompState();