Skip to content

Commit 711a96d

Browse files
committed
Add comments about why both positional input checks are required in OsuClickableContainer
1 parent 15bd82a commit 711a96d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

osu.Game/Graphics/Containers/OsuClickableContainer.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ public partial class OsuClickableContainer : ClickableContainer, IHasTooltip
1717

1818
private readonly Container content = new Container { RelativeSizeAxes = Axes.Both };
1919

20-
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => base.ReceivePositionalInputAt(screenSpacePos) && Content.ReceivePositionalInputAt(screenSpacePos);
20+
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
21+
// base call is checked for cases when `OsuClickableContainer` has masking applied to it directly (ie. externally in object initialisation).
22+
base.ReceivePositionalInputAt(screenSpacePos)
23+
// Implementations often apply masking / edge rounding at a content level, so it's imperative to check that as well.
24+
&& Content.ReceivePositionalInputAt(screenSpacePos);
2125

2226
protected override Container<Drawable> Content => content;
2327

0 commit comments

Comments
 (0)