mirror of https://github.com/ppy/osu
Snap to stack in osu! composer when dragging to any of the items on it
Previously it would be required to drag to the starting position of the stack which feels weird.
This commit is contained in:
parent
ec9040798f
commit
9cc0e0137b
|
@ -295,6 +295,12 @@ private bool snapToVisibleBlueprints(Vector2 screenSpacePosition, out SnapResult
|
|||
|
||||
if (Vector2.Distance(closestSnapPosition, screenSpacePosition) < snapRadius)
|
||||
{
|
||||
// if the snap target is a stacked object, snap to its unstacked position rather than its stacked position.
|
||||
// this is intended to make working with stacks easier (because thanks to this, you can drag an object to any
|
||||
// of the items on the stack to add an object to it, rather than having to drag to the position of the *first* object on it at all times).
|
||||
if (b.Item is OsuHitObject osuObject && osuObject.StackOffset != Vector2.Zero)
|
||||
closestSnapPosition = b.ToScreenSpace(b.ToLocalSpace(closestSnapPosition) - osuObject.StackOffset);
|
||||
|
||||
// only return distance portion, since time is not really valid
|
||||
snapResult = new SnapResult(closestSnapPosition, null, playfield);
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue