I\'ve created a kind of \'polygon selector\' or \'polygon maker\' using fabric.js. Each click creates a corner of the polygon, which can be selected, moved, etc... double clicki
if getActiveGroup() is not available then you can use this to group (after mouse selecting multiple objects):
toGroup() is only available if multiple objects are selected
var activeObj = canvas.getActiveObject();
var activegroup = activeObj.toGroup();
var objectsInGroup = activegroup.getObjects();
activegroup.clone(function(newgroup) {
canvas.remove(activegroup);
objectsInGroup.forEach(function(object) {
canvas.remove(object);
});
canvas.add(newgroup);
});
changes http://fabricjs.com/v2-breaking-changes-2