0

I am using GEF and Eclipse draw2d.There is a FreeformViewPort on which the figures are rendered. I have connection anchors in the figure to connect the figures. When I scroll down the viewport and click on a connection anchor of a figure,the mouse coordinates returned by the MouseEvent are wrong.It gives me the coordinates of where the anchor is located on the viewport rather than its actual location,that is, if the view port has a height of 300 and the anchor is located at 400,400.When I scroll down 100 and click on the anchor then instead of getting 400,400 I would get 400,300.

How can I receive the actual location of the anchor?

1 Answers1

0

figure.translateToRelative(pt);

pt will be 400,400 after execution of the above line.