laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
33 lines (32 loc) • 739 B
JavaScript
"use client";
import { polarToCartesian as e } from "../PolarUtils.js";
import { getRadialCursorPoints as z } from "./getRadialCursorPoints.js";
function b(h, r, l) {
var x, p, u, y;
if (h === "horizontal")
x = r.x, u = x, p = l.top, y = l.top + l.height;
else if (h === "vertical")
p = r.y, y = p, x = l.left, u = l.left + l.width;
else if (r.cx != null && r.cy != null)
if (h === "centric") {
var {
cx: i,
cy: m,
innerRadius: t,
outerRadius: w,
angle: s
} = r, g = e(i, m, t, s), n = e(i, m, w, s);
x = g.x, p = g.y, u = n.x, y = n.y;
} else
return z(r);
return [{
x,
y: p
}, {
x: u,
y
}];
}
export {
b as getCursorPoints
};