mirror of
https://github.com/ppy/osu
synced 2025-02-03 03:42:15 +00:00
Stop cursor from sticking to edges of scaled game window
This commit is contained in:
parent
89b5707f2b
commit
3abfaea7ac
@ -28,6 +28,8 @@ namespace osu.Game.Graphics.Containers
|
||||
private readonly Container content;
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
|
||||
|
||||
private readonly Container sizableContainer;
|
||||
|
||||
private Drawable backgroundLayer;
|
||||
@ -41,7 +43,7 @@ namespace osu.Game.Graphics.Containers
|
||||
this.targetMode = targetMode;
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
InternalChild = sizableContainer = new Container
|
||||
InternalChild = sizableContainer = new AlwaysInputContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
RelativePositionAxes = Axes.Both,
|
||||
@ -55,6 +57,8 @@ namespace osu.Game.Graphics.Containers
|
||||
private readonly bool applyUIScale;
|
||||
private Bindable<float> uiScale;
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
|
||||
|
||||
public ScalingDrawSizePreservingFillContainer(bool applyUIScale)
|
||||
{
|
||||
this.applyUIScale = applyUIScale;
|
||||
@ -143,5 +147,15 @@ namespace osu.Game.Graphics.Containers
|
||||
sizableContainer.MoveTo(targetPosition, 500, Easing.OutQuart);
|
||||
sizableContainer.ResizeTo(targetSize, 500, Easing.OutQuart).OnComplete(_ => { sizableContainer.Masking = requiresMasking; });
|
||||
}
|
||||
|
||||
private class AlwaysInputContainer : Container
|
||||
{
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
|
||||
|
||||
public AlwaysInputContainer()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user