是否有任何简单的集成方法可以检测曲线上的鼠标悬停事件? 我希望将贝塞尔曲线作为可移动和可编辑的元素添加到 Canvas 中,并且我需要一种方法来选择它们。
我宁愿不使用任何外部库(用于教育目的);
最佳答案
这个答案是几年前写的,因为kinetic.js不再维护并且链接不起作用。
您可以尝试crete.js (http://www.concretejs.com)。
I would check the kinetic.js library. It is html5 canvas library, that supports many features including curve detection. You can try some examples here:
http://www.html5canvastutorials.com/labs/html5-canvas-curve-detection-tutorial/
http://www.html5canvastutorials.com/labs/html5-canvas-physics-engine-with-curve-detection/
If you do not want to use other libraries and still have great speed, you could try the following approach.
关于javascript - 鼠标悬停在贝塞尔曲线上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11815227/