I am doing an eclipse plug-in using GEF for drawing graphs. I am using a FigureCanvas to display the graphs. When I am scrolling canvas is there any way to get the distance that the canvas was scrolled?
Asked
Active
Viewed 251 times
1 Answers
1
You can translate the coordinates from the scrolled figure to the relative coordinate system. Try this:
org.eclipse.draw2d.geometry.Point p = new org.eclipse.draw2d.geometry.Point(e.x,e.y);
root.translateToRelative(p);
Then use the p.x and p.y when referring to the coordinate

Phil
- 276
- 1
- 10