问题描述
有没有简单的集成方法来检测曲线上的鼠标悬停事件?
我希望将bezier曲线添加到画布作为可移动和可编辑的元素,我需要一种方法来选择它们。
Is there any easy integrated way to detect a mouseover event on a curve?I wish to add bezier curves to the canvas as movable and editable elements and I need a way to select them.
我宁愿不使用任何外部库(用于教育目的);
I would rather not use any external libraries (for educational purposes);
推荐答案
这个答案是几年前写的,因为kinetic.js不再维护和链接不工作。
This answer was written several years ago and since kinetic.js is no longer maintained and the links don't work.
你可以尝试concrete.js()。
You can try concrete.js (http://www.concretejs.com).
如果您不想使用其他库并且速度仍然很快,可以尝试以下方法。
If you do not want to use other libraries and still have great speed, you could try the following approach.
这篇关于鼠标在Bezier曲线上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!