mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Schedule adding transforms on tablet changes
Fixes `InvalidThreadForMutationException`s that pop up when disconnecting/reconnecting tablets during the game's operation. In those cases the value change callback executes from an OpenTabletDriver thread.
This commit is contained in:
@ -125,17 +125,20 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
}, true);
|
||||
|
||||
tablet.BindTo(handler.Tablet);
|
||||
tablet.BindValueChanged(val =>
|
||||
{
|
||||
tabletContainer.Size = val.NewValue?.Size ?? Vector2.Zero;
|
||||
tabletName.Text = val.NewValue?.Name ?? string.Empty;
|
||||
checkBounds();
|
||||
}, true);
|
||||
tablet.BindValueChanged(_ => Scheduler.AddOnce(updateTabletDetails));
|
||||
|
||||
updateTabletDetails();
|
||||
// initial animation should be instant.
|
||||
FinishTransforms(true);
|
||||
}
|
||||
|
||||
private void updateTabletDetails()
|
||||
{
|
||||
tabletContainer.Size = tablet.Value?.Size ?? Vector2.Zero;
|
||||
tabletName.Text = tablet.Value?.Name ?? string.Empty;
|
||||
checkBounds();
|
||||
}
|
||||
|
||||
private static int greatestCommonDivider(int a, int b)
|
||||
{
|
||||
while (b != 0)
|
||||
|
Reference in New Issue
Block a user