Let user delete a selected fabric js object

后端 未结 5 762
青春惊慌失措
青春惊慌失措 2021-02-05 02:03

I have a simple fabric js based application where I will let users add shapes connect them and animate them.

Following is my JS

var canvas; 
window.newA         


        
5条回答
  •  粉色の甜心
    2021-02-05 03:09

    Edit: This is for older versions now.

    You can use the remove() method, eg.

    window.deleteObject = function() {
            canvas.getActiveObject().remove();
    }
    

    jsfiddle

提交回复
热议问题