Files
NapCatQQ/.pnpm-store/v3/files/41/2f2fe765d3630594324062f7e63f3feca2f293d52906491cc854b4dd934e513f74a0aa50fcd6b22c8ed5a39eb437057795a32209fa1e5bde22a5e5b4bc8254
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

44 lines
779 B
Plaintext

/**
* @file 矩形转换成轮廓
* @author mengke01(kekee000@gmail.com)
*/
/**
* 矩形转换成轮廓
*
* @param {number} x 左上角x
* @param {number} y 左上角y
* @param {number} width 宽度
* @param {number} height 高度
* @return {Array} 轮廓数组
*/
export default function rect2contour(x, y, width, height) {
x = +x;
y = +y;
width = +width;
height = +height;
return [
{
x,
y,
onCurve: true
},
{
x: x + width,
y,
onCurve: true
},
{
x: x + width,
y: y + height,
onCurve: true
},
{
x,
y: y + height,
onCurve: true
}
];
}