add io mask rotation snapping

This commit is contained in:
llama 2025-07-20 08:31:54 +08:00
parent 8c72b03f4c
commit 91983d2043
No known key found for this signature in database
GPG key ID: 0B7543854B9413C3

View file

@ -106,6 +106,9 @@ function initCanvas(): fabric.Canvas {
fabric.Object.prototype.cornerStyle = "circle";
fabric.Object.prototype.cornerStrokeColor = "#000000";
fabric.Object.prototype.padding = 8;
// snap rotation around 0 by +-3deg
fabric.Object.prototype.snapAngle = 360;
fabric.Object.prototype.snapThreshold = 3;
// disable rotation when selecting
canvas.on("selection:created", () => {
const g = canvas.getActiveObject();