liwei 1 年之前
父節點
當前提交
2cdb9bcd9a
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/modules/editor/objects/DesignTemp/creates/createCompStyle.ts

+ 6 - 1
src/modules/editor/objects/DesignTemp/creates/createCompStyle.ts

@@ -72,7 +72,12 @@ export function createCompStyle(
 
  
     
-  
+  const [w, h, sizeOpts] = layout.size;
+
+  style.width = designToNaturalSize(w);
+  style.height = designToNaturalSize(h, {
+      adaptiveH: sizeOpts?.unit === "%",
+  });
 
   if (layout.transformMatrix) {
     //样式的scale转 width