/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The markers' geometry (#57, #1393): where an item drawn as a dot or a * labelled pin stands on the screen, and the words a pin draws — what the * painter draws a marker by (`paint.ts`), what a tap meets it in, and the edge * a link's end meets (`routes.ts`' `endShape`), so the clickable area is the * drawn one (invariant 27). Pure: no React, no DOM. * * @packageDocumentation */ import { type ScreenCamera } from "./camera"; /** Drawn radius of a `dot`-tier marker, in screen px. */ export declare const MARKER_DOT_RADIUS = 5; /** Hit radius of a `dot`-tier marker, in screen px — comfortably over the * drawn dot (5) and its selected ring (7.5) for touch slop (issue #57, P11). */ export declare const MARKER_DOT_HIT_RADIUS = 10; /** The screen-space hitbox of a non-card LOD marker — a circle for a `dot`, the * rounded-pill rect for a `label`, with the words it draws. */ export type MarkerHitbox = { kind: "circle"; cx: number; cy: number; r: number; } | { kind: "rect"; left: number; top: number; w: number; h: number; text: string; }; /** * The screen-space hitbox of an item's LOD marker at `tier`. The single source * of truth used by **both** {@link paintSchematic} (to draw the pill) and the * React layer's pick (to hit-test), so the clickable area always equals the * drawn area and the two cannot silently drift (issue #57, P11). A `dot` is a * circle of {@link MARKER_DOT_HIT_RADIUS}; a `label` is the rounded pill whose * width is `pad + dot + gap + textWidth + pad`, no wider than * {@link SCHEMATIC_CARD_MAX_PX} — its words the label, or as much of it as fits * before an ellipsis (#1393), each measured by `measure` (the caller sets the * context font to the palette's `labelFont` first) — its dot on its item's * point and its words after it ({@link PIN_LEAD_PX}), so the status it shows * stands where its item does, never on a neighbour's. * * @param item - the item's world anchor and label * @param tier - the LOD tier (`dot` or `label`; `card` markers are DOM) * @param cam - the screen camera * @param measure - measures a string's width in px under the pin font * @returns the marker's screen-space hitbox, and a pill's words */ export declare function markerHitbox(item: { x: number; y: number; label: string; }, tier: "dot" | "label", cam: ScreenCamera, measure: (text: string) => number): MarkerHitbox; /** * Whether the screen point `(sx, sy)` falls inside `box` (see * {@link markerHitbox}). * * @param box - a marker hitbox * @param sx - screen x * @param sy - screen y * @returns `true` when the point is inside the hitbox */ export declare function markerHit(box: MarkerHitbox, sx: number, sy: number): boolean; //# sourceMappingURL=markers.d.ts.map