mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 09:32:55 +08:00
Make HitCirclePlacementMask directly modify hitcircle position
This commit is contained in:
parent
6eb7a030d0
commit
f42f9cffe3
@ -19,6 +19,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Masks
|
|||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
InternalChild = new HitCircleMask(HitObject);
|
InternalChild = new HitCircleMask(HitObject);
|
||||||
|
|
||||||
|
HitObject.PositionChanged += _ => Position = HitObject.StackedPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -26,21 +28,19 @@ namespace osu.Game.Rulesets.Osu.Edit.Masks
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
// Fixes a 1-frame position discrpancy due to the first mouse move event happening in the next frame
|
// Fixes a 1-frame position discrpancy due to the first mouse move event happening in the next frame
|
||||||
Position = GetContainingInputManager().CurrentState.Mouse.Position;
|
HitObject.Position = GetContainingInputManager().CurrentState.Mouse.Position;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnClick(ClickEvent e)
|
protected override bool OnClick(ClickEvent e)
|
||||||
{
|
{
|
||||||
HitObject.StartTime = EditorClock.CurrentTime;
|
HitObject.StartTime = EditorClock.CurrentTime;
|
||||||
HitObject.Position = e.MousePosition;
|
|
||||||
|
|
||||||
EndPlacement();
|
EndPlacement();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseMove(MouseMoveEvent e)
|
protected override bool OnMouseMove(MouseMoveEvent e)
|
||||||
{
|
{
|
||||||
Position = e.MousePosition;
|
HitObject.Position = e.MousePosition;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user