拉斐尔·JS。两个形状之间的橡皮筋路径
任何人都有在 Raphael 中在两个形状之间绘制橡皮筋样式路径的示例代码。
我在 如何绘制矢量中看到了一些有关逐步绘制路径的问题循序渐进的路径? (Raphael.js)
但我的要求是能够单击一个形状并将鼠标移动到另一个形状,并且当鼠标移动时,应该有一条像橡皮筋一样跟随鼠标的线条路径。一旦单击第二个形状,线条路径就必须被锁定。
我尝试了 Joint.js http:// www.jointjs.com/ 与Raphael,但它可以画线,但不能交互。
Anyone has sample code for drawing a rubber band style path between two shapes in Raphael.
I saw few questions around drawing path progressively at How to draw a vector path progressively? (Raphael.js)
But my requirement is to be able to click on one shape and move the mouse to the other shape and while the mouse moves, there should be a line path following the mouse like a rubber band. Once the click happens on the second shape the line path has to be locked in.
I tried the Joint.js http://www.jointjs.com/ with Raphael but it can draw lines but not interactively.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下是入门的基本代码:
您可以在此处查看演示:http://jsfiddle.net/57myn/
Here is the basic code to get you started:
You can check out a demo here: http://jsfiddle.net/57myn/