vendredi 27 janvier 2017

Canvas/fabricjs: How to group items?

I have an error when grouping elements. The error is only visible on the circles. Circles are rectangles. How to group items?

var activegroup = canvas.getActiveGroup();
var objectsInGroup = activegroup.getObjects();
activegroup.clone(function (newgroup) {
    canvas.discardActiveGroup();
    objectsInGroup.forEach(function (object) {
        canvas.remove(object);
    });
    canvas.add(newgroup);
});

The full code

Video bug




Aucun commentaire:

Enregistrer un commentaire