1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 20:07:25 +08:00

Avoid null by calling initial OnDeselected later

This commit is contained in:
Dean Herbert 2020-01-21 17:36:21 +09:00
parent 195068ba9a
commit 24a466ab24

View File

@ -40,11 +40,15 @@ namespace osu.Game.Rulesets.Edit
protected SelectionBlueprint(HitObject hitObject) protected SelectionBlueprint(HitObject hitObject)
{ {
this.HitObject = hitObject; HitObject = hitObject;
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
}
AlwaysPresent = true; [BackgroundDependencyLoader]
private void load()
{
OnDeselected(); OnDeselected();
AlwaysPresent = true;
} }
private SelectionState state; private SelectionState state;
@ -116,5 +120,7 @@ namespace osu.Game.Rulesets.Edit
/// The screen-space quad that outlines this <see cref="OverlaySelectionBlueprint"/> for selections. /// The screen-space quad that outlines this <see cref="OverlaySelectionBlueprint"/> for selections.
/// </summary> /// </summary>
public virtual Quad SelectionQuad => ScreenSpaceDrawQuad; public virtual Quad SelectionQuad => ScreenSpaceDrawQuad;
public Vector2 GetInstantDelta(Vector2 screenSpacePosition) => Parent.ToLocalSpace(screenSpacePosition) - Position;
} }
} }