fix: Skips layout for SingleLayoutGroup with no children
This commit is contained in:
@@ -32,6 +32,7 @@ namespace Cryville.Common.Unity.UI {
|
||||
public override void SetLayoutVertical() { SetChildrenAlongAxis(1); }
|
||||
|
||||
protected void CalcAlongAxis(int axis) {
|
||||
if (rectChildren.Count == 0) return;
|
||||
float combinedPadding = (axis == 0) ? padding.horizontal : padding.vertical;
|
||||
bool controlSize = (axis == 0) ? m_ChildControlWidth : m_ChildControlHeight;
|
||||
bool useScale = (axis == 0) ? m_ChildScaleWidth : m_ChildScaleHeight;
|
||||
@@ -55,6 +56,7 @@ namespace Cryville.Common.Unity.UI {
|
||||
}
|
||||
|
||||
protected void SetChildrenAlongAxis(int axis) {
|
||||
if (rectChildren.Count == 0) return;
|
||||
float size = rectTransform.rect.size[axis];
|
||||
bool controlSize = (axis == 0) ? m_ChildControlWidth : m_ChildControlHeight;
|
||||
bool useScale = (axis == 0) ? m_ChildScaleWidth : m_ChildScaleHeight;
|
||||
|
Reference in New Issue
Block a user