fabricjs - Deselection fabric.js object event -
fabricjs - Deselection fabric.js object event -
i trying execute code every time specific fabric object "deselected". there deselection event can handle? have function when object selected, via selected event, have not found documentation deselected one. @ canvas level have selection:cleared , selection:created events, nil deselection either.
cheers, gonzalo
use before:selection:cleared
event , active object or group. after can check if corresponds specific fabric object.
canvas.on('before:selection:cleared', function() { var clearedobject; if(typeof(canvas.getactiveobject()) !== 'undefined') { clearedobject = canvas.getactiveobject(); } else { clearedobject = canvas.getactivegroup(); } //do stuff deselected element if specific 1 want. });
fabricjs
Comments
Post a Comment