add io mask rotation snapping (#4214)

This commit is contained in:
llama 2025-07-22 19:32:42 +08:00 committed by GitHub
parent 47c1094195
commit 1f3d03f7f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -106,6 +106,9 @@ function initCanvas(): fabric.Canvas {
fabric.Object.prototype.cornerStyle = "circle"; fabric.Object.prototype.cornerStyle = "circle";
fabric.Object.prototype.cornerStrokeColor = "#000000"; fabric.Object.prototype.cornerStrokeColor = "#000000";
fabric.Object.prototype.padding = 8; 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 // disable rotation when selecting
canvas.on("selection:created", () => { canvas.on("selection:created", () => {
const g = canvas.getActiveObject(); const g = canvas.getActiveObject();