canvas.scale(scale,scale,px,py) jerks to a new position

删除回忆录丶 提交于 2019-12-06 01:55:00
chochim

Please see the answer by @ToreRudberg here - You might want to reform your code to correct the behavior your'e observing.

This is because your scaling pivot coords (touchX and touchY) are initially 0, and when you first scale, it suddenly changes them to the focus point of the scale gesture:

        touchX = detector.getFocusX();
        touchY = detector.getFocusY();

It works with 1.0 initial scale because 1.0f scale does not change anything, so you don't see the sudden pivot jump at the beginning.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!