1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:23:22 +08:00

MouseDownPosition -> DragPosition

This commit is contained in:
Dean Herbert 2018-11-30 14:21:20 +09:00
parent 5254b07680
commit a1666fb7fa
2 changed files with 8 additions and 8 deletions

View File

@ -15,8 +15,8 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
{ {
public class ManiaSelectionBlueprint : SelectionBlueprint public class ManiaSelectionBlueprint : SelectionBlueprint
{ {
public Vector2 ScreenSpaceMouseDownPosition { get; private set; } public Vector2 ScreenSpaceDragPosition { get; private set; }
public Vector2 MouseDownPosition { get; private set; } public Vector2 DragPosition { get; private set; }
protected new DrawableManiaHitObject HitObject => (DrawableManiaHitObject)base.HitObject; protected new DrawableManiaHitObject HitObject => (DrawableManiaHitObject)base.HitObject;
@ -49,8 +49,8 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
protected override bool OnMouseDown(MouseDownEvent e) protected override bool OnMouseDown(MouseDownEvent e)
{ {
ScreenSpaceMouseDownPosition = e.ScreenSpaceMousePosition; ScreenSpaceDragPosition = e.ScreenSpaceMousePosition;
MouseDownPosition = HitObject.ToLocalSpace(e.ScreenSpaceMousePosition); DragPosition = HitObject.ToLocalSpace(e.ScreenSpaceMousePosition);
return base.OnMouseDown(e); return base.OnMouseDown(e);
} }
@ -59,8 +59,8 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
{ {
var result = base.OnDrag(e); var result = base.OnDrag(e);
ScreenSpaceMouseDownPosition = e.ScreenSpaceMousePosition; ScreenSpaceDragPosition = e.ScreenSpaceMousePosition;
MouseDownPosition = HitObject.ToLocalSpace(e.ScreenSpaceMousePosition); DragPosition = HitObject.ToLocalSpace(e.ScreenSpaceMousePosition);
return result; return result;
} }

View File

@ -49,8 +49,8 @@ namespace osu.Game.Rulesets.Mania.Edit
{ {
var referenceParent = (HitObjectContainer)reference.HitObject.Parent; var referenceParent = (HitObjectContainer)reference.HitObject.Parent;
float offsetFromReferenceOrigin = reference.MouseDownPosition.Y - reference.HitObject.OriginPosition.Y; float offsetFromReferenceOrigin = reference.DragPosition.Y - reference.HitObject.OriginPosition.Y;
float targetPosition = referenceParent.ToLocalSpace(reference.ScreenSpaceMouseDownPosition).Y - offsetFromReferenceOrigin; float targetPosition = referenceParent.ToLocalSpace(reference.ScreenSpaceDragPosition).Y - offsetFromReferenceOrigin;
// Flip the vertical coordinate space when scrolling downwards // Flip the vertical coordinate space when scrolling downwards
if (scrollingInfo.Direction.Value == ScrollingDirection.Down) if (scrollingInfo.Direction.Value == ScrollingDirection.Down)