Make the Fabric.js object draggable, but not selectable,

Fabric.js has this really cool aspect where it allows you to select all objects by default, which means that they are capable of dragging, resizing and rotating. However, I would like them to be draggable without resizing or rotating. Is it possible? I do not object to avoiding the source, if this is what is needed, it would be better than re-executing it.

+7
source share
2 answers

Nevermind, I found the answer here: http://fabricjs.com/customization/

This is the line that does this

canvas.item(0).hasControls = false; 
+10
source

when creating, pass the following parameters to the object:

 hasBorders: false hasControls: false hasRotatingPoint: false 
+7
source

All Articles