Skip to content

Commit

Permalink
Reduce some redundancy in StartDrag with its parent implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemonaco committed Jan 16, 2022
1 parent b6a15bd commit e7bef82
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions TileShop.WPF/Features/Pixel Editor/PixelEditorViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,9 @@ public override void StartDrag(IDragInfo dragInfo)

Selection = new ArrangerSelection(WorkingArranger, SnapMode);
}
else if (Paste is not null)
else
{
Paste.DeltaX = (int)dragInfo.DragStartPosition.X - Paste.Rect.SnappedLeft;
Paste.DeltaY = (int)dragInfo.DragStartPosition.Y - Paste.Rect.SnappedTop;
Paste.SnapMode = SnapMode;

dragInfo.Data = Paste;
dragInfo.Effects = DragDropEffects.Copy | DragDropEffects.Move;
base.StartDrag(dragInfo);
}
}
#endregion
Expand Down

0 comments on commit e7bef82

Please sign in to comment.