mirror of
https://github.com/ppy/osu.git
synced 2024-11-12 06:07:28 +08:00
Merge pull request #12513 from peppy/tablet-rotated-preview
Show tablet preview with physical tablet counter-rotated for supplied user area
This commit is contained in:
commit
452f282e2c
@ -129,9 +129,10 @@ 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.
|
||||
});
|
||||
}, true);
|
||||
|
||||
tablet.BindTo(handler.Tablet);
|
||||
tablet.BindValueChanged(_ => Scheduler.AddOnce(updateTabletDetails));
|
||||
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user