From 42411c39fb295757c92c8201c12986b5a5c407fb Mon Sep 17 00:00:00 2001 From: Gulam Nabi Azad Date: Mon, 8 Jul 2024 10:44:49 +0530 Subject: [PATCH] WI00737678---RemoveDragNodesBehavior---Update-4 --- .../Behaviors/DragMovablesBehavior.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Blazor.Diagrams.Core/Behaviors/DragMovablesBehavior.cs b/src/Blazor.Diagrams.Core/Behaviors/DragMovablesBehavior.cs index 0bd146b1..15106cd2 100644 --- a/src/Blazor.Diagrams.Core/Behaviors/DragMovablesBehavior.cs +++ b/src/Blazor.Diagrams.Core/Behaviors/DragMovablesBehavior.cs @@ -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()) { @@ -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) @@ -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; } -} +} \ No newline at end of file