1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-19 09:52:53 +08:00

Merge pull request #25442 from bdach/argon-health-bar-sizing-broken

Fix argon health bar not relative sizing correctly
This commit is contained in:
Dean Herbert 2023-11-14 23:10:03 +09:00 committed by GitHub
commit 6e0375e3e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,7 +141,13 @@ namespace osu.Game.Screens.Play.HUD
Current.BindValueChanged(_ => Scheduler.AddOnce(updateCurrent), true);
// we're about to set `RelativeSizeAxes` depending on the value of `UseRelativeSize`.
// setting `RelativeSizeAxes` internally transforms absolute sizing to relative and back to keep the size the same,
// but that is not what we want in this case, since the width at this point is valid in the *target* sizing mode.
// to counteract this, store the numerical value here, and restore it after setting the correct initial relative sizing axes.
float previousWidth = Width;
UseRelativeSize.BindValueChanged(v => RelativeSizeAxes = v.NewValue ? Axes.X : Axes.None, true);
Width = previousWidth;
BarHeight.BindValueChanged(_ => updatePath(), true);
}