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

43 lines
718 B
Plaintext

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