liwei 1 жил өмнө
parent
commit
2cdb9bcd9a

+ 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