Don't snap to global grid while placing grid

This commit is contained in:
OliBomby 2024-09-23 17:24:09 +02:00
parent fe10621771
commit 0f0f490598
3 changed files with 5 additions and 1 deletions

View File

@ -70,6 +70,8 @@ protected override bool OnMouseDown(MouseDownEvent e)
return base.OnMouseDown(e);
}
public override SnapType SnapType => ~SnapType.GlobalGrids;
public override void UpdateTimeAndPosition(SnapResult result)
{
var pos = ToLocalSpace(result.ScreenSpacePosition);

View File

@ -71,6 +71,8 @@ public virtual void EndPlacement(bool commit)
PlacementActive = PlacementState.Finished;
}
public virtual SnapType SnapType => SnapType.All;
/// <summary>
/// Updates the time and position of this <see cref="PlacementBlueprint"/> based on the provided snap information.
/// </summary>

View File

@ -297,7 +297,7 @@ private void refreshTool()
private void updatePlacementPosition()
{
var snapResult = Composer.FindSnappedPositionAndTime(InputManager.CurrentState.Mouse.Position);
var snapResult = Composer.FindSnappedPositionAndTime(InputManager.CurrentState.Mouse.Position, CurrentPlacement.SnapType);
// if no time was found from positional snapping, we should still quantize to the beat.
snapResult.Time ??= Beatmap.SnapTime(EditorClock.CurrentTime, null);