Skip to content

Commit

Permalink
Merge pull request #75 from fantasydr/fix-unintentional-movement
Browse files Browse the repository at this point in the history
Fix the unintentional movement caused by snapping correction
  • Loading branch information
miroiu authored Oct 31, 2023
2 parents 36fab14 + 1fab72f commit 1f222b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
> - Fixed PendingConnection.PreviewTarget not being set to null when there is no actual target
> - Fixed connectors panel not being affected by Node.VerticalAlignment
> - Changing BorderThickness causes layout shift when selecting an item container
> - Fixed the unintentional movement caused by snapping correction
#### **Version 5.0.2**

Expand Down
2 changes: 1 addition & 1 deletion Nodify/Helpers/DraggingOptimized.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void End(Vector change)
Point result = container.Location + new Vector(r.X, r.Y);

// Correct the final position
if (NodifyEditor.EnableSnappingCorrection)
if (NodifyEditor.EnableSnappingCorrection && (r.X != 0 || r.Y != 0))
{
result.X = (int)result.X / _editor.GridCellSize * _editor.GridCellSize;
result.Y = (int)result.Y / _editor.GridCellSize * _editor.GridCellSize;
Expand Down

0 comments on commit 1f222b8

Please sign in to comment.