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

Show tablet preview with physical tablet counter-rotated for supplied user area selection

Closes https://github.com/ppy/osu/issues/12399.

Rotation animation is intentionally delayed slightly to give a better sense of what is going on (or maybe just look cool).
This commit is contained in:
Dean Herbert 2021-04-21 15:55:13 +09:00
parent 6164902eba
commit eb20865c02

View File

@ -129,6 +129,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
rotation.BindTo(handler.Rotation);
rotation.BindValueChanged(val =>
{
tabletContainer.RotateTo(-val.NewValue, 800, Easing.OutQuint);
usableAreaContainer.RotateTo(val.NewValue, 100, Easing.OutQuint)
.OnComplete(_ => checkBounds()); // required as we are using SSDQ.
});
@ -183,8 +184,10 @@ namespace osu.Game.Overlays.Settings.Sections.Input
if (!(tablet.Value?.Size is Vector2 size))
return;
float fitX = size.X / (DrawWidth - Padding.Left - Padding.Right);
float fitY = size.Y / DrawHeight;
float maxDimension = size.LengthFast;
float fitX = maxDimension / (DrawWidth - Padding.Left - Padding.Right);
float fitY = maxDimension / DrawHeight;
float adjust = MathF.Max(fitX, fitY);