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

32 lines
676 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = pathCeil;
/**
* @file 对路径进行四舍五入
* @author mengke01(kekee000@gmail.com)
*/
/**
* 对path坐标进行调整
*
* @param {Array} contour 轮廓点数组
* @param {number} point 四舍五入的点数
* @return {Object} contour 坐标点
*/
function pathCeil(contour, point) {
var p;
for (var i = 0, l = contour.length; i < l; i++) {
p = contour[i];
if (!point) {
p.x = Math.round(p.x);
p.y = Math.round(p.y);
} else {
p.x = Number(p.x.toFixed(point));
p.y = Number(p.y.toFixed(point));
}
}
return contour;
}