1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 18:43:04 +08:00

Give control over screen space conversion to DrawableHitObject

This commit is contained in:
smoogipoo 2017-12-11 22:19:02 +09:00
parent 2f1063c5c0
commit a303bf71cf
3 changed files with 5 additions and 6 deletions

View File

@ -167,7 +167,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
public Drawable ProxiedLayer => initialCircle.ApproachCircle;
public override Vector2 SelectionPoint => body.Position;
public override Vector2 SelectionPoint => ToScreenSpace(body.Position);
public override Quad SelectionQuad => body.PathDrawQuad;
}

View File

@ -115,8 +115,7 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
if (!obj.IsAlive || !obj.IsPresent)
continue;
var objectPosition = obj.ToScreenSpace(obj.SelectionPoint);
if (ScreenSpaceDrawQuad.Contains(objectPosition))
if (ScreenSpaceDrawQuad.Contains(obj.SelectionPoint))
capturedHitObjects.Add(obj);
}
}

View File

@ -42,12 +42,12 @@ namespace osu.Game.Rulesets.Objects.Drawables
}
/// <summary>
/// The local point that causes this <see cref="DrawableHitObject"/> to be selected in the Editor.
/// The screen-space point that causes this <see cref="DrawableHitObject"/> to be selected in the Editor.
/// </summary>
public virtual Vector2 SelectionPoint => DrawSize / 2f;
public virtual Vector2 SelectionPoint => ScreenSpaceDrawQuad.Centre;
/// <summary>
/// The local rectangle that outlines this <see cref="DrawableHitObject"/> for selections in the Editor.
/// The screen-space quad that outlines this <see cref="DrawableHitObject"/> for selections in the Editor.
/// </summary>
public virtual Quad SelectionQuad => ScreenSpaceDrawQuad;
}