Grouping and Ungrouping Fabric.js objects

后端 未结 3 1115
庸人自扰
庸人自扰 2021-02-06 07:37

I\'ve created a kind of \'polygon selector\' or \'polygon maker\' using fabric.js. Each click creates a corner of the polygon, which can be selected, moved, etc... double clicki

3条回答
  •  感情败类
    2021-02-06 08:00

        if (!canvas.getActiveObject()) {
          return;
        }
        if (canvas.getActiveObject().type !== 'group') {
          return;
        }
        canvas.getActiveObject().toActiveSelection();
        canvas.requestRenderAll();
    

    From : http://fabricjs.com/manage-selection

提交回复
热议问题