TLCommentAnchor
Where a comment thread is anchored on the canvas. Modeled as a discriminated union so new anchor kinds can be added without breaking existing threads:
shape— pinned to a shape.x/yare normalized (0–1) within the shape's bounds, so the pin keeps its spot as the shape moves, resizes, and rotates.isPrecisemirrors arrow bindings: when false (the default) the pin sits at a consumer-defined spot instead, top-right out of the box, andx/yare the remembered precise position -point— pinned to a fixed point on the page, in page coordinates -region— pinned to a rectangular area of the page, in page coordinates -page— a page-level thread with no spatial anchor
type TLCommentAnchor =
| {
pinX?: number;
h: number;
pinY?: number;
type: "region";
w: number;
x: number;
y: number;
}
| {
isPrecise: boolean;
shapeId: TLShapeId;
type: "shape";
x: number;
y: number;
}
| {
type: "page";
}
| {
type: "point";
x: number;
y: number;
};Prev
TLCanvasUiColorNext
TLCommentId