How to make objects in canvas unsuitable?

I want to make the whole object on the canvas non-selectable. I found a selection method , but I did not find a way to implement it for all objects.

+7
source share
3 answers

You can make all items non-selectable using the code below

canvas.deactivateAll();
canvas.renderAll();
canvas.forEachObject(function(object){ 
       object.selectable = false; 
});
+8
source

There is such a way in the option -

selectable: false

      or 

object.set({selectable:false})

      or


 object.selectable = false;
+7
source

Fabric Text , , , SO, , .

"selectable": false : - , " " ( ).

"Evented": . :

this.canvas.add(new fabric.Text("Hello world !", {
            "selectable": false,
            "evented": false
}));

You can play with various control options here: http://fabricjs.com/controls-customization

0
source

All Articles