出于性能和美学的原因,我正在使用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
更多推荐
发布评论