Files
NapCatQQ/.pnpm-store/v3/files/ae/510d008278c1279b146514801480ce75f549dd127bb41e838e3be870290834de37a1cb6f4d02bb15c84e70beb616555e30d16fadc5e7bfb6dbe2b4998a393b
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

28 lines
640 B
Plaintext

/**
* @file 对路径进行四舍五入
* @author mengke01(kekee000@gmail.com)
*/
/**
* 对path坐标进行调整
*
* @param {Array} contour 轮廓点数组
* @param {number} point 四舍五入的点数
* @return {Object} contour 坐标点
*/
export default function pathCeil(contour, point) {
let p;
for (let 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;
}