@mocanvas/editor · function

rotateSelectionHandle

declare function rotateSelectionHandle<T extends SelectionCorner | SelectionEdge>(handle: T, rotation: number): T

The handle you are really dragging once the selection is rotated.

A shape rotated a quarter turn puts its top_left handle where an unrotated shape's top_right would be, so a resize has to be resolved against the shape's own axes before it means anything. Both corners and edges rotate, in the same clockwise ring, an eighth of a turn per step.

SEMANTICS-ASSUMED: the docs give the signature only. Rounding to the nearest eighth is the choice that makes a 45° rotation resolve to the corner between the two edges rather than flapping between them.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.