1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-01 06:19:54 +08:00

Fix null reference in some test scenes

This commit is contained in:
Dean Herbert
2025-06-03 14:45:57 +09:00
Unverified
parent 90b9fb0809
commit 8a12935577
+5 -2
View File
@@ -70,13 +70,16 @@ namespace osu.Game.Screens.SelectV2
public sealed override bool ReceivePositionalInputAt(Vector2 screenSpacePos)
{
if (item == null)
return TopLevelContent.ReceivePositionalInputAt(screenSpacePos);
var inputRectangle = TopLevelContent.DrawRectangle;
// Cover the gaps introduced by the spacing between panels so that user mis-aims don't result in no-ops.
inputRectangle = inputRectangle.Inflate(new MarginPadding
{
Top = item!.CarouselInputLenienceAbove,
Bottom = item!.CarouselInputLenienceBelow,
Top = item.CarouselInputLenienceAbove,
Bottom = item.CarouselInputLenienceBelow,
});
return inputRectangle.Contains(TopLevelContent.ToLocalSpace(screenSpacePos));