Paper.js鼠标事件未使用画布转换进行转换(Paper.js mouse events not translating with canvas transforms)

编程入门 行业动态 更新时间:2024-10-28 19:33:44
Paper.js鼠标事件未使用画布转换进行转换(Paper.js mouse events not translating with canvas transforms)

出于性能和美学的原因,我正在使用CSS变换(旋转)将Paper.js“drawing”转换为画布。 基本上,在滚动时,画布旋转,并具有转换持续时间以使其平滑。

最重要的是,我的Paper.js路径上有鼠标事件,因此在悬停时它们会改变颜色。 但是,当CSS变换应用于画布时,鼠标事件“消失”,因为缺少更好的单词,并且它们不起作用。 我猜想沿着这条线的某个地方,CSS变换正在处理画布绘制的元素,但是在与我的路径绑定的Paper.js创建的鼠标事件上跳过或应用不同。 有什么解决方案吗?

For performance and aesthetic reasons, I am transforming a canvas with a Paper.js "drawing" in it with a CSS transform (rotation). Basically, on scroll, the canvas rotates, with a transition-duration to smooth it out.

On top of that, my Paper.js paths have mouse events on them so that on hover they change color. However, when the CSS transform is applied to the canvas, the mouse events "disappear," for lack of a better word, and they don't work. I guess somewhere along the line, the CSS transform is working on the canvas drawn elements but is skipping over or applied differently on the mouse events created by Paper.js tied to my paths. Is there any solution?

最满意答案

我在这里回答了同样的问题: https : //github.com/paperjs/paper.js/issues/945

I have answered the same question here: https://github.com/paperjs/paper.js/issues/945

更多推荐

本文发布于:2023-08-03 05:34:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1383921.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:鼠标   画布   事件   js   Paper

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!