javascript - 鼠标悬停在贝塞尔曲线上

标签 javascript html events canvas bezier

是否有任何简单的集成方法可以检测曲线上的鼠标悬停事件? 我希望将贝塞尔曲线作为可移动和可编辑的元素添加到 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/

http://www.html5canvastutorials.com/labs/html5-canvas-modify-curves-with-anchor-points-using-kineticjs/

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/

相关文章:

html - 如何不覆盖 HTML 中多个 SVG 的样式

vb.net - 在 Excel Workbook.BeforePrint 事件中检测打印机

javascript - jQuery datepicker - 本地代码不起作用?

javascript - onmouseover方法动态分配

html - 我的文本框中的文本与左中心对齐。我该如何删除它?

java - 将点击处理程序添加到 GWT 中的 Horizo​​ntalPanel

c++ - Windows 中的按键事件

javascript - 来自 RESTful 端点的响应不符合预期?

javascript - 使用 Javascript 加载 DarkSky 后格式化日期、时间和温度

javascript - 范围的 Modernizr 函数