FabricJS double click on objects

前端 未结 6 492
孤街浪徒
孤街浪徒 2021-01-02 08:04

I am trying to perform a special action whenever the user double clicks any object located inside the canvas. I have read the docs and not found any mouse:dblclick

6条回答
  •  被撕碎了的回忆
    2021-01-02 08:24

    This is similar to @LeoCreer's answer but actually gets access to the targeted object

    fabric.util.addListener(canvas.upperCanvasEl, 'dblclick', function (e) {
      var target = canvas.findTarget(e);
    });
    

提交回复
热议问题