mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 16:32:54 +08:00
Fix initial LayoutSettings
animation in a more reliable way
This commit is contained in:
parent
adb4fd5a2b
commit
212842c537
@ -175,16 +175,14 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
scalingMode.BindValueChanged(mode =>
|
||||
{
|
||||
scalingSettings.ClearTransforms();
|
||||
|
||||
scalingSettings.AutoSizeDuration = transition_duration;
|
||||
scalingSettings.AutoSizeEasing = Easing.OutQuint;
|
||||
scalingSettings.AutoSizeAxes = mode.NewValue != ScalingMode.Off ? Axes.Y : Axes.None;
|
||||
|
||||
if (mode.NewValue == ScalingMode.Off)
|
||||
scalingSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
|
||||
updateScalingModeVisibility();
|
||||
});
|
||||
|
||||
scalingSettings.ForEach(s => s.TransferValueOnCommit = mode.NewValue == ScalingMode.Everything);
|
||||
}, true);
|
||||
// initial update bypasses transforms
|
||||
updateScalingModeVisibility();
|
||||
|
||||
void updateResolutionDropdown()
|
||||
{
|
||||
@ -193,6 +191,15 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
else
|
||||
resolutionDropdown.Hide();
|
||||
}
|
||||
|
||||
void updateScalingModeVisibility()
|
||||
{
|
||||
if (scalingMode.Value == ScalingMode.Off)
|
||||
scalingSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
|
||||
|
||||
scalingSettings.AutoSizeAxes = scalingMode.Value != ScalingMode.Off ? Axes.Y : Axes.None;
|
||||
scalingSettings.ForEach(s => s.TransferValueOnCommit = scalingMode.Value == ScalingMode.Everything);
|
||||
}
|
||||
}
|
||||
|
||||
private void bindPreviewEvent(Bindable<float> bindable)
|
||||
|
Loading…
Reference in New Issue
Block a user