Update CanvasStateApiModule.ts

Add temporary grid snap with ctrl, optional small step with ctrl+shift, while grid snap is off
This commit is contained in:
Ar7ific1al
2025-07-29 15:35:56 -05:00
committed by psychedelicious
parent 7a23d8266f
commit fa94a05c77

View File

@@ -319,6 +319,14 @@ export class CanvasStateApiModule extends CanvasModuleBase {
getPositionGridSize = (): number => {
const snapToGrid = this.getSettings().snapToGrid;
if (!snapToGrid) {
const overrideSnap = this.$ctrlKey.get() || this.$metaKey.get();
if (overrideSnap) {
const useFine = this.$shiftKey.get();
if (useFine) {
return 8;
}
return 64;
}
return 1;
}
const useFine = this.$ctrlKey.get() || this.$metaKey.get();