mirror of
https://github.com/ppy/osu
synced 2024-12-24 15:53:37 +00:00
Fix incorrect circle piece hitbox
Hitboxes of circle pieces in osu! have regressed with commit 8592335
.
The reason for the regression was that hit detection was moved from
DrawableHitCircle itself to a newly-introduced private HitArea class
(now named HitReceptor).
As HitArea inherited from Drawable, it would return IsHovered == true
over its entire bounding box. This meant that the hit area could wrongly
pick up actions that are not within circle radius and make them into
hits.
To resolve, make HitReceptor a CompositeDrawable and set its corner
radius to match the circle piece. This fixes the invalid hitbox, as
IsHovered takes radius into account.
This commit is contained in:
parent
491840b17d
commit
77fd748035
@ -170,7 +170,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
public Drawable ProxiedLayer => ApproachCircle;
|
public Drawable ProxiedLayer => ApproachCircle;
|
||||||
|
|
||||||
public class HitReceptor : Drawable, IKeyBindingHandler<OsuAction>
|
public class HitReceptor : CompositeDrawable, IKeyBindingHandler<OsuAction>
|
||||||
{
|
{
|
||||||
// IsHovered is used
|
// IsHovered is used
|
||||||
public override bool HandlePositionalInput => true;
|
public override bool HandlePositionalInput => true;
|
||||||
@ -185,6 +185,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
|
CornerRadius = OsuHitObject.OBJECT_RADIUS;
|
||||||
|
CornerExponent = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool OnPressed(OsuAction action)
|
public bool OnPressed(OsuAction action)
|
||||||
|
Loading…
Reference in New Issue
Block a user