Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在做一个使用 GEF 绘制图形的 eclipse 插件。我正在使用 FigureCanvas 来显示图表。当我滚动画布时,有什么方法可以获得画布滚动的距离?
您可以将坐标从滚动图形转换为相对坐标系。尝试这个:
org.eclipse.draw2d.geometry.Point p = new org.eclipse.draw2d.geometry.Point(e.x,e.y); root.translateToRelative(p);
然后在引用坐标时使用px和py