Multiple Select Fabric canvas objects by Ctrl Key and set it to Active

37 Views Asked by At

Context: I'm using fabricjs canvas to draw all my icons/texts on it. For each icon/text, I've set the listener for moved, scaled and rotated:

enter image description here

Currently it allows only select one object to move, scale and rotate. I'm implementing the feature for multiple select there.

Problem: I'm trying to find the solution to setting active object for the new selection objects.

I've grouped these selected objects and set it to active by setActiveObject(newGroup) on the selection:updated event. But, when I set active objects the selection:updated fired again so its in the endless loop until this error occurred:

enter image description here

Any solution?

There is an issue for the same problem but it's fixed directly on the library function but I'm using yarn/npm. https://stackoverflow.com/questions/62872779/fabricjs-selection-handling-multiple-objects

0

There are 0 best solutions below