Skip to content

Commit 8e49094

Browse files
committed
feat: 添加逻辑判断
1 parent 8b1cdbb commit 8e49094

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Runtime/FairyGUIFormHelper.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,12 @@ 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;
91+
if (uiForm.IsCenter)
92+
{
93+
component.x = (uiGroupComponent.width - component.width) / 2f;
94+
component.y = (uiGroupComponent.height - component.height) / 2f;
95+
}
96+
9397
return uiForm;
9498
}
9599

0 commit comments

Comments
 (0)