I want to let users rotate objects on the Fabric.js powered canvas, but limit their rotation to 90 deg increments. Idea is that as they rotate and then stop, the object woul
FabricJS now supports this natively through 'setAngle', along with 'snapThreshold' property.
https://github.com/kangax/fabric.js/pull/3383
Example:
canvas.add(new fabric.Circle({
snapAngle: 90,
snapThreshold: 45,
left: 100,
top: 100,
radius:50,
fill: '#9f9',
centeredRotation: true
}));
https://jsfiddle.net/2t2d1zj9/1/