gong-wpf-dragdrop icon indicating copy to clipboard operation
gong-wpf-dragdrop copied to clipboard

DropTargetAdorners.Highlight has wrong location

Open RedX2501 opened this issue 1 year ago • 1 comments

Describe the bug When you have non-visible elements the Highlight border is misaligned.

To Reproduce Steps to reproduce the behavior:

Open project, drag element onto target element.

DragDropBugReport.zip

This project uses the latest version with .net 6 but I have the problem with .net framework 4.7.2.

Expected behavior The highlight border should be around the gray element but is offset.

The computation of the size to highlight is correct but the offset is not.

Desktop (please complete the following information):

  • OS: Win 10

  • Version: DragDrop 3.1.1

Additional context Add any other context about the problem here.

RedX2501 avatar Jul 08 '22 14:07 RedX2501

I do realize that a workaround exists by moving the dd:IsDropTarget to the border.

I do still think this is a problem since there is a code to calculate the accurate size of the target but the offset is not considered.

RedX2501 avatar Jul 08 '22 14:07 RedX2501

@RedX2501 The problem here was that the target UserControl doesn't set a Background brush (like Transparent) to use the entire bounds. So the result is then the wrong position for the inner bounds. Workaround is to set the Background, but I also fixed that now.

punker76 avatar Sep 07 '22 10:09 punker76