Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

418 B
Raw Blame
import { dotGridLevels } from '@macro-inc/graphics';

export type CanvasSnapMode = 'none' | 'pixel' | 'auto';

export function canvasSnapUnit(
  mode: CanvasSnapMode,
  scale: number,
  gridVisible: boolean
): number | undefined {
  if (mode === 'none') return undefined;
  if (mode === 'pixel') return 1;
  if (!gridVisible) return undefined;
  return dotGridLevels(scale).find((level) => level.opacity > 0)?.unit;
}