1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 08:03:12 +08:00

Remove unnecessary bindable

This commit is contained in:
Dean Herbert 2022-04-14 19:13:54 +09:00
parent bb4322a4c4
commit 7582c2a5e8

View File

@ -84,7 +84,7 @@ namespace osu.Game.Graphics.Containers
private readonly bool applyUIScale;
private Bindable<float> uiScale;
private readonly Bindable<float> currentScale = new Bindable<float>(1);
private float currentScale = 1;
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
@ -99,19 +99,14 @@ namespace osu.Game.Graphics.Containers
if (applyUIScale)
{
uiScale = osuConfig.GetBindable<float>(OsuSetting.UIScale);
uiScale.BindValueChanged(scaleChanged, true);
uiScale.BindValueChanged(args => this.TransformTo(nameof(currentScale), args.NewValue, duration, Easing.OutQuart), true);
}
}
private void scaleChanged(ValueChangedEvent<float> args)
{
this.TransformBindableTo(currentScale, args.NewValue, duration, Easing.OutQuart);
}
protected override void Update()
{
Scale = new Vector2(currentScale.Value);
Size = new Vector2(1 / currentScale.Value);
Scale = new Vector2(currentScale);
Size = new Vector2(1 / currentScale);
base.Update();
}