Skip to content

Commit 8b1cdbb

Browse files
committed
feat: 添加默认居中适配
1 parent 43b07a3 commit 8b1cdbb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Runtime/FairyGUIFormHelper.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ public override IUIForm CreateUIForm(object uiFormInstance, Type uiFormType, obj
8888
}
8989

9090
uiGroupComponent.AddChild(component);
91+
component.x = (uiGroupComponent.width - component.width) / 2f;
92+
component.y = (uiGroupComponent.height - component.height) / 2f;
9193
return uiForm;
9294
}
9395

0 commit comments

Comments
 (0)