/** * Shared pointer-to-canvas coordinate mapping for the interactive overlay * tools (color picker, densitometer, measure). * * Each tool's click-capture surface is an absolutely-positioned `inset: 0` * div over the rendered page. It receives viewport-space pointer coordinates * (`clientX`/`clientY`) but needs them in the canvas's **internal** coordinate * space — the space `canvasWidth`/`canvasHeight` are expressed in, which both * the PDF-point mapping and the on-page readout/markers use. * * In the host's separation/layer views the overlay's parent is sized exactly * to `canvasWidth`/`canvasHeight` with no transform, so the element's on-screen * rect matches and the scale is 1 (a no-op). In the default page view the * overlay lives **inside** the substrate's CSS zoom/pan transform, so the * element's on-screen rect is `canvasWidth × scale`. Scaling the * rect-relative offset by `canvasWidth / rect.width` recovers the internal * coordinate, keeping sampling and marker placement exact at any zoom. */ /** Minimal shape of the parts of a `DOMRect` this mapping reads. */ export interface RectLike { left: number; top: number; width: number; height: number; } /** * Map a viewport-space pointer position to the canvas's internal coordinate * space, given the click-capture element's on-screen bounding rect. * * A degenerate rect (zero width/height — e.g. an unmeasured element) falls * back to scale 1 so the offset passes through unchanged rather than dividing * by zero. */ export declare function toCanvasXY(clientX: number, clientY: number, rect: RectLike, canvasWidth: number, canvasHeight: number): [number, number]; //# sourceMappingURL=toolCoords.d.ts.map