mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:52:53 +08:00
Add comments about why both positional input checks are required in OsuClickableContainer
This commit is contained in:
parent
15bd82add8
commit
edc78205d5
@ -17,7 +17,11 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
private readonly Container content = new Container { RelativeSizeAxes = Axes.Both };
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => base.ReceivePositionalInputAt(screenSpacePos) && Content.ReceivePositionalInputAt(screenSpacePos);
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
|
||||
// base call is checked for cases when `OsuClickableContainer` has masking applied to it directly (ie. externally in object initialisation).
|
||||
base.ReceivePositionalInputAt(screenSpacePos)
|
||||
// Implementations often apply masking / edge rounding at a content level, so it's imperative to check that as well.
|
||||
&& Content.ReceivePositionalInputAt(screenSpacePos);
|
||||
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
|
@ -61,7 +61,11 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
protected override Container<Drawable> Content { get; }
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => base.ReceivePositionalInputAt(screenSpacePos) && Content.ReceivePositionalInputAt(screenSpacePos);
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
|
||||
// base call is checked for cases when `OsuClickableContainer` has masking applied to it directly (ie. externally in object initialisation).
|
||||
base.ReceivePositionalInputAt(screenSpacePos)
|
||||
// Implementations often apply masking / edge rounding at a content level, so it's imperative to check that as well.
|
||||
&& Content.ReceivePositionalInputAt(screenSpacePos);
|
||||
|
||||
protected Box Hover;
|
||||
protected Box Background;
|
||||
|
Loading…
Reference in New Issue
Block a user