I'm currently working on a canvas built with fabric.js.
I have three objects on a canvas:
My problem is that when I multiselect them (by using my mouse), they all became capable of resizing/replacing etc.
My question is: How can I disable grouping them together, so that the first two objects cannot be select?
I have already tried canvas.selection = false
- but this option disables the whole canvas.
To disable the ability to click and drag in order to select multiple objects you can simply add a key:value pair in the options of the fabric.Canvas initialization...
let canvas = new fabric.Canvas("some_id_attribute_value",{selection: false});
The specific key value is selection:false and "some_id_attribute_value" is whatever you specified as the id of the canvas element(basic canvas init step). I was also having this problem, hope this helps!
I don't know if I follow your question but each object has a selectable
property.
Perhaps that will help?
selectable : Boolean
When set tofalse
, an object can not be selected for modification (using either point-click-based or group-based selection). But events still fire on it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.