feat(annotator): responsive layout for the loupe (#3568)

This commit is contained in:
Huang Xin
2026-03-20 00:54:24 +08:00
committed by GitHub
parent 764acf59de
commit 1f4f5f8a6d
5 changed files with 29 additions and 54 deletions
@@ -13,18 +13,12 @@ export const getHighlightColorHex = (
return customColors?.[color] ?? HIGHLIGHT_COLOR_HEX[color];
};
export function getEffectiveLoupePoint(
loupePoint: Point | null,
externalDragPoint: Point | null | undefined,
): Point | null {
return loupePoint ?? externalDragPoint ?? null;
}
export function getExternalDragHandle(
externalDragPoint: Point,
currentStart: Point,
currentEnd: Point,
): 'start' | 'end' {
externalDragPoint?: Point | null,
): 'start' | 'end' | null {
if (!externalDragPoint) return null;
const distToStart = Math.hypot(
externalDragPoint.x - currentStart.x,
externalDragPoint.y - currentStart.y,