1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 04:02:59 +08:00

Fix initial LayoutSettings animation in a more reliable way

This commit is contained in:
Dean Herbert 2021-08-17 12:38:44 +09:00
parent adb4fd5a2b
commit 212842c537

View File

@ -175,16 +175,14 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
scalingMode.BindValueChanged(mode => scalingMode.BindValueChanged(mode =>
{ {
scalingSettings.ClearTransforms(); scalingSettings.ClearTransforms();
scalingSettings.AutoSizeDuration = transition_duration; scalingSettings.AutoSizeDuration = transition_duration;
scalingSettings.AutoSizeEasing = Easing.OutQuint; scalingSettings.AutoSizeEasing = Easing.OutQuint;
scalingSettings.AutoSizeAxes = mode.NewValue != ScalingMode.Off ? Axes.Y : Axes.None;
if (mode.NewValue == ScalingMode.Off) updateScalingModeVisibility();
scalingSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint); });
scalingSettings.ForEach(s => s.TransferValueOnCommit = mode.NewValue == ScalingMode.Everything); // initial update bypasses transforms
}, true); updateScalingModeVisibility();
void updateResolutionDropdown() void updateResolutionDropdown()
{ {
@ -193,6 +191,15 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
else else
resolutionDropdown.Hide(); 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) private void bindPreviewEvent(Bindable<float> bindable)