1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-17 22:17:25 +08:00

Update sizing as early as possible in addition to scheduling (to handle any dependent edge cases)

This commit is contained in:
Dean Herbert 2020-11-05 17:24:59 +09:00
parent 8293846afc
commit 9c91f16e3a

View File

@ -112,7 +112,15 @@ namespace osu.Game.Tests.Visual
}
};
Schedule(() =>
// run this once initially to bring things into a sane state as early as possible.
updateSizing();
// run this once after construction to handle the case the changes are made in a BDL/LoadComplete call.
Schedule(updateSizing);
return children;
void updateSizing()
{
var autoSize = created.RelativeSizeAxes == Axes.None;
@ -123,9 +131,7 @@ namespace osu.Game.Tests.Visual
}
outlineBox.Alpha = autoSize ? 1 : 0;
});
return children;
}
}
/// <summary>