xx hace 11 meses
padre
commit
37b86766c2

+ 9 - 6
assets/script/edit/animation/new_frame.ts

@@ -240,16 +240,19 @@ export class new_frame extends Component {
             if(up_frame.anchor_point_y==undefined||up_frame==null) {
                 up_frame.anchor_point_y = 0.5
             }
-            if(up_frame.scale_x==undefined||up_frame==null) {
-                up_frame.scale_x = 1
-            }
-            if(up_frame.scale_y==undefined||up_frame==null) {
-                up_frame.scale_y = 1
-            }
+       
         } 
         this.m_data.rotation = up_frame?up_frame.rotation:0
         this.m_data.anchor_point_x = up_frame?up_frame.anchor_point_x:att.anchor_x
         this.m_data.anchor_point_y = up_frame?up_frame.anchor_point_y:att.anchor_y
+
+        if(up_frame.scale_x==undefined) {
+            up_frame.scale_x = 1
+        }
+        if(up_frame.scale_y==undefined) {
+            up_frame.scale_y = 1
+        }
+
         this.m_data.scale_x = up_frame.scale_x
         this.m_data.scale_y = up_frame.scale_y
         this.lab_origin_pos.getComponent(Label).string = `(x:${Math.floor(att.x)},y:${Math.floor(att.y)})`

+ 6 - 0
assets/script/run/widget/widget_base.ts

@@ -241,6 +241,12 @@ export class widget_base extends Component {
         this.bindTarget.opacity = up_frame.transparent;
         this.bindTarget.size = new Size(up_frame.size_width,up_frame.size_height)
         this.bindTarget.pos = new Vec3(up_frame.pos_x,up_frame.pos_y)
+        up_frame.scale_x = up_frame.scale_x==undefined?1:up_frame.scale_x
+        up_frame.scale_y = up_frame.scale_y==undefined?1:up_frame.scale_y
+
+        frame.scale_x = frame.scale_x==undefined?1:frame.scale_x
+        frame.scale_y = frame.scale_y==undefined?1:frame.scale_y
+
         this.bindTarget.scale = new Vec3(up_frame.scale_x,up_frame.scale_y)
         this.bindTarget.anchorPointX = up_frame.anchor_point_x==undefined?0.5:up_frame.anchor_point_x
         this.bindTarget.anchorPointY = up_frame.anchor_point_y==undefined?0.5:up_frame.anchor_point_y