In Paper.js, is there a simple way to select the closest point (relative to mouse)?

我们两清 提交于 2019-12-11 12:42:35

问题


I wish to interactively move handles or points in a path with the mouse. I think I can manage to program a scan in all points and handles and compute the one at mouse position. But is there a more simple way to select them?


回答1:


You can use getNearestPoint(cursorPoint) method which can be invoked from Path item

Link to the documentation with an example: http://paperjs.org/reference/path/#getnearestpoint-point



来源:https://stackoverflow.com/questions/31227091/in-paper-js-is-there-a-simple-way-to-select-the-closest-point-relative-to-mous

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