import type { PointerEvent as ReactPointerEvent } from "react"; import type { OverlayRect } from "./domEditOverlayGeometry"; /** Rotate handle below the selection: an attached circular-arrows icon chip * (no connecting stem). Anchors to the crop outline when the element is * cropped so it stays next to what's visible on screen. Presentation only — * the rotation gesture measures pointer angles from the element CENTER * (resolveDomEditRotationGesture), so the handle position doesn't affect the * math. Sits 12px below the bbox, past the bottom crop handle's hit strip. */ export function DomEditRotateHandle({ overlayRect, cropOutlineInsetPx, onStartRotate, }: { overlayRect: OverlayRect; cropOutlineInsetPx?: { top: number; right: number; bottom: number; left: number }; onStartRotate: (e: ReactPointerEvent) => void; }) { const inset = cropOutlineInsetPx ?? { top: 0, right: 0, bottom: 0, left: 0 }; const visibleLeft = overlayRect.left + inset.left; const visibleWidth = Math.max(0, overlayRect.width - inset.left - inset.right); const visibleBottom = overlayRect.top + overlayRect.height - inset.bottom; return ( ); }