diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-04 15:26:21 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-04 15:26:21 +0200 |
| commit | 6900c4dea48adb484efc9648e081b7b3f75bd60c (patch) | |
| tree | 78cebaa7e24d9c36b14d25c35f5679403e5b1ce3 /Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs | |
| parent | 0681c34b56580e3c5c37d95bf1c3f948d95c2302 (diff) | |
| download | Tango-6900c4dea48adb484efc9648e081b7b3f75bd60c.tar.gz Tango-6900c4dea48adb484efc9648e081b7b3f75bd60c.zip | |
Progress on Machine Designer..
Diffstat (limited to 'Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs index 5e6182efa..52cb0d954 100644 --- a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs +++ b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs @@ -432,13 +432,23 @@ namespace Tango.DragAndDrop foreach (var dropElement in _dropElements.Where(x => x != _currentDragedElement)) { - Point dropPoint = dropElement.TransformToAncestor(rootElement).Transform(new Point(0, 0)); + if (!dropElement.IsLoaded) + { + dropElement.UpdateLayout(); + dropElement.InvalidateArrange(); + dropElement.InvalidateMeasure(); + dropElement.InvalidateVisual(); + continue; + } + + //Point dropPoint = dropElement.TransformToAncestor(rootElement).Transform(new Point(0, 0)); + Point dropPoint = dropElement.PointToScreen(new Point(0, 0)); Rect dropRect = new Rect(dropPoint, new Size(dropElement.ActualWidth, dropElement.ActualHeight)); Rect dragRect = new Rect(Canvas.GetLeft(_dragBorder), Canvas.GetTop(_dragBorder), _dragBorder.Width / 2, _dragBorder.Height); Point mousePoint = rootElement.PointToScreen(Mouse.GetPosition(rootElement)); - if (dropRect.IntersectsWith(dragRect)) + if (dropRect.IntersectsWith(new Rect(mousePoint, new Size(1, 1)))) { SetIsDraggableOver(dropElement, true); |
