easyeda 0.0.380 → 0.0.381
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +7 -14
- package/dist/browser/index.js.map +1 -1
- package/dist/index.js +7 -14
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +8 -15
- package/dist/main.cjs.map +1 -1
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -1078,7 +1078,7 @@ var import_promises = __toESM(require("fs/promises"), 1);
|
|
|
1078
1078
|
var package_default = {
|
|
1079
1079
|
name: "easyeda",
|
|
1080
1080
|
type: "module",
|
|
1081
|
-
version: "0.0.
|
|
1081
|
+
version: "0.0.380",
|
|
1082
1082
|
files: [
|
|
1083
1083
|
"dist"
|
|
1084
1084
|
],
|
|
@@ -15585,22 +15585,15 @@ function generateArcFromSweep(startX, startY, endX, endY, radius, largeArcFlag,
|
|
|
15585
15585
|
const centerY = midY - h * Math.cos(angle) * centerDirection;
|
|
15586
15586
|
const startAngle = Math.atan2(startY - centerY, startX - centerX);
|
|
15587
15587
|
let endAngle = Math.atan2(endY - centerY, endX - centerX);
|
|
15588
|
-
if (sweepFlag && endAngle
|
|
15589
|
-
endAngle -= 2 * Math.PI;
|
|
15590
|
-
} else if (!sweepFlag && endAngle < startAngle) {
|
|
15588
|
+
if (sweepFlag && endAngle < startAngle) {
|
|
15591
15589
|
endAngle += 2 * Math.PI;
|
|
15590
|
+
} else if (!sweepFlag && endAngle > startAngle) {
|
|
15591
|
+
endAngle -= 2 * Math.PI;
|
|
15592
15592
|
}
|
|
15593
|
-
|
|
15594
|
-
|
|
15595
|
-
|
|
15596
|
-
|
|
15597
|
-
endAngle += 2 * Math.PI;
|
|
15598
|
-
}
|
|
15599
|
-
}
|
|
15600
|
-
const numPoints = Math.max(
|
|
15601
|
-
2,
|
|
15602
|
-
Math.ceil(Math.abs(endAngle - startAngle) * radius)
|
|
15603
|
-
);
|
|
15593
|
+
const arcAngle = Math.abs(endAngle - startAngle);
|
|
15594
|
+
const minNumPoints = Math.max(2, Math.ceil(arcAngle * radius));
|
|
15595
|
+
const isSemicircle = Math.abs(arcAngle - Math.PI) < 1e-6;
|
|
15596
|
+
const numPoints = isSemicircle ? minNumPoints + minNumPoints % 2 : minNumPoints;
|
|
15604
15597
|
const path = [];
|
|
15605
15598
|
for (let i = 0; i <= numPoints; i++) {
|
|
15606
15599
|
const t = i / numPoints;
|