This question is locked. New answers and comments are not allowed.
When a user right clicks in the diagram when it is zoomed, the mouse position does not match the coordinates of the diagram.
I tried using the zoom factor as a modifier to find the object on the diagram but that doesn't work either. The original version of this method just used the mouse position as the pastePoint and that works fine when not zoomed. How should I handle finding the object that is right clicked so that the context menu can be modified depending on what the user clicks on.
PS this is a deployed application and the version can't be changed. It is currently using version 2.3.0.16766.
Point p = context.MousePosition;
pastePoint =
new
Point(zoomFact * p.X, zoomFact * p.Y);
Point mfTestPoint = Application.Current.RootVisual.TransformToVisual(currentDiagram.DocumentPlane).Transform(pastePoint);
DiagramNode clickedItem3 = currentDiagram.GetNodeAt(pastePoint,
false
,
true
);
CustomDiagramLink clickedItem4 = (CustomDiagramLink)currentDiagram.GetLinkAt(pastePoint, 5,
true
);
I tried using the zoom factor as a modifier to find the object on the diagram but that doesn't work either. The original version of this method just used the mouse position as the pastePoint and that works fine when not zoomed. How should I handle finding the object that is right clicked so that the context menu can be modified depending on what the user clicks on.
PS this is a deployed application and the version can't be changed. It is currently using version 2.3.0.16766.