1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 04:07:25 +08:00

Extend slider selection box bounds to contain all control points inside

Previously, the selection box was only guaranteed to contain the actual
body of the slider itself, the control point nodes were allowed to exit
it. This lead to a lot of weird interactions with the selection box
controls (rotation/drag handles, also the buttons under/over it) as the
slider anchors could overlap with them.

To bypass this issue entirely just ensure that the selection box's size
does include the control point nodes at all times.
This commit is contained in:
Bartłomiej Dach 2024-06-18 10:28:36 +02:00
parent 316125d47a
commit 87888ff0bb
No known key found for this signature in database

View File

@ -54,7 +54,21 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
[Resolved(CanBeNull = true)]
private BindableBeatDivisor beatDivisor { get; set; }
public override Quad SelectionQuad => BodyPiece.ScreenSpaceDrawQuad;
public override Quad SelectionQuad
{
get
{
var result = BodyPiece.ScreenSpaceDrawQuad.AABBFloat;
if (ControlPointVisualiser != null)
{
foreach (var piece in ControlPointVisualiser.Pieces)
result = RectangleF.Union(result, piece.ScreenSpaceDrawQuad.AABBFloat);
}
return result;
}
}
private readonly BindableList<PathControlPoint> controlPoints = new BindableList<PathControlPoint>();
private readonly IBindable<int> pathVersion = new Bindable<int>();