【发布时间】:2022-04-26 11:14:29
【问题描述】:
我一直在尝试让 FabricJs 画布与多点触控平移和缩放一起使用,但无济于事。我尝试了无数的自定义构建,但该事件没有任何可处理的触摸信息。这是我使用的代码:
let fabricCanvas = new fabric.Canvas('myCanvas', {
width: canvasContainer.current.offsetWidth,
height: canvasContainer.current.offsetHeight,
isDrawingMode: true
})
fabricCanvas.on({
'touch:gesture': function(e) {
console.log(e) // returns empty object wen fired with fabricCanvas.fire("touch:gesture")
}
});
fabricCanvas.fire("touch:gesture") // I can only make the listener fire, by doing this
如何使提供的手势正常工作?
【问题讨论】:
标签: fabricjs