1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 04:52:57 +08:00

Merge pull request #20480 from peppy/fix-drawable-mutation-tablet-settings

Fix potential crash from incorrect drawable mutation in tablet settings display
This commit is contained in:
Dan Balasescu 2022-09-26 18:16:52 +09:00 committed by GitHub
commit f2eed881bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -215,21 +215,21 @@ namespace osu.Game.Overlays.Settings.Sections.Input
rotation.BindTo(tabletHandler.Rotation); rotation.BindTo(tabletHandler.Rotation);
areaOffset.BindTo(tabletHandler.AreaOffset); areaOffset.BindTo(tabletHandler.AreaOffset);
areaOffset.BindValueChanged(val => areaOffset.BindValueChanged(val => Schedule(() =>
{ {
offsetX.Value = val.NewValue.X; offsetX.Value = val.NewValue.X;
offsetY.Value = val.NewValue.Y; offsetY.Value = val.NewValue.Y;
}, true); }), true);
offsetX.BindValueChanged(val => areaOffset.Value = new Vector2(val.NewValue, areaOffset.Value.Y)); offsetX.BindValueChanged(val => areaOffset.Value = new Vector2(val.NewValue, areaOffset.Value.Y));
offsetY.BindValueChanged(val => areaOffset.Value = new Vector2(areaOffset.Value.X, val.NewValue)); offsetY.BindValueChanged(val => areaOffset.Value = new Vector2(areaOffset.Value.X, val.NewValue));
areaSize.BindTo(tabletHandler.AreaSize); areaSize.BindTo(tabletHandler.AreaSize);
areaSize.BindValueChanged(val => areaSize.BindValueChanged(val => Schedule(() =>
{ {
sizeX.Value = val.NewValue.X; sizeX.Value = val.NewValue.X;
sizeY.Value = val.NewValue.Y; sizeY.Value = val.NewValue.Y;
}, true); }), true);
sizeX.BindValueChanged(val => sizeX.BindValueChanged(val =>
{ {
@ -255,7 +255,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
}); });
tablet.BindTo(tabletHandler.Tablet); tablet.BindTo(tabletHandler.Tablet);
tablet.BindValueChanged(val => tablet.BindValueChanged(val => Schedule(() =>
{ {
Scheduler.AddOnce(updateVisibility); Scheduler.AddOnce(updateVisibility);
@ -274,7 +274,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
sizeY.Default = sizeY.MaxValue = tab.Size.Y; sizeY.Default = sizeY.MaxValue = tab.Size.Y;
areaSize.Default = new Vector2(sizeX.Default, sizeY.Default); areaSize.Default = new Vector2(sizeX.Default, sizeY.Default);
}, true); }), true);
} }
private void updateVisibility() private void updateVisibility()