Skip to content

Commit

Permalink
WI00737678---RemoveDragNodesBehavior---Update-4
Browse files Browse the repository at this point in the history
  • Loading branch information
gnawisetech committed Jul 8, 2024
1 parent b852ab2 commit 42411c3
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/Blazor.Diagrams.Core/Behaviors/DragMovablesBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ protected override void OnPointerDown(Model? model, PointerEventArgs e)
if (model is not MovableModel)
return;

ResetPan();

_initialPositions.Clear();
foreach (var sm in Diagram.GetSelectedModels())
{
Expand Down Expand Up @@ -72,7 +70,7 @@ protected override void OnPointerMove(Model? model, PointerEventArgs e)
_lastClientY = e.ClientY;

}

protected virtual void OnPanChanged(double deltaX, double deltaY)
{
if (_initialPositions.Count == 0 || _lastClientX == null || _lastClientY == null)
Expand Down Expand Up @@ -132,14 +130,9 @@ private double ApplyGridSize(double n)
return gridSize * Math.Floor((n + gridSize / 2.0) / gridSize);
}

void ResetPan()
{
Diagram.SetPan(0, 0);
}

public override void Dispose()
{
_initialPositions.Clear();
Diagram.PanChanged -= OnPanChanged;
}
}
}

0 comments on commit 42411c3

Please sign in to comment.