import { MM_TO_PX } from "@/lib/drive/page-formats"

/** One inch in page coordinate space (matches CSS print px). */
export const DOCS_RULER_INCH_PX = MM_TO_PX * 25.4

export function docsZoomToScale(zoom: number): number {
  return zoom / 100
}

export function docsPageLengthToScreen(lengthPx: number, scale: number): number {
  return lengthPx * scale
}

export function docsScreenLengthToPage(lengthPx: number, scale: number): number {
  if (scale <= 0) return lengthPx
  return lengthPx / scale
}
