Zoom in with affinetransform swing

徘徊边缘 提交于 2019-12-06 11:21:52
trashgod

This example centers and scales a Shape, p3, by

  • translating a point of symmetry to the origin,

  • scaling the Polygon and then

  • translating back to the panel's center.

Note that the concatenated operations are performed in the (apparent) reverse of the declaration order, as discussed here.

at.setToIdentity();
at.translate(w / 2, h / 2);
at.scale(scale, scale);
at.translate(-p3x[5] + 10, -p3y[5]); 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!