|
@@ -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();
|