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/index.js
CHANGED
|
@@ -14448,22 +14448,15 @@ function generateArcFromSweep(startX, startY, endX, endY, radius, largeArcFlag,
|
|
|
14448
14448
|
const centerY = midY - h * Math.cos(angle) * centerDirection;
|
|
14449
14449
|
const startAngle = Math.atan2(startY - centerY, startX - centerX);
|
|
14450
14450
|
let endAngle = Math.atan2(endY - centerY, endX - centerX);
|
|
14451
|
-
if (sweepFlag && endAngle
|
|
14452
|
-
endAngle -= 2 * Math.PI;
|
|
14453
|
-
} else if (!sweepFlag && endAngle < startAngle) {
|
|
14451
|
+
if (sweepFlag && endAngle < startAngle) {
|
|
14454
14452
|
endAngle += 2 * Math.PI;
|
|
14453
|
+
} else if (!sweepFlag && endAngle > startAngle) {
|
|
14454
|
+
endAngle -= 2 * Math.PI;
|
|
14455
14455
|
}
|
|
14456
|
-
|
|
14457
|
-
|
|
14458
|
-
|
|
14459
|
-
|
|
14460
|
-
endAngle += 2 * Math.PI;
|
|
14461
|
-
}
|
|
14462
|
-
}
|
|
14463
|
-
const numPoints = Math.max(
|
|
14464
|
-
2,
|
|
14465
|
-
Math.ceil(Math.abs(endAngle - startAngle) * radius)
|
|
14466
|
-
);
|
|
14456
|
+
const arcAngle = Math.abs(endAngle - startAngle);
|
|
14457
|
+
const minNumPoints = Math.max(2, Math.ceil(arcAngle * radius));
|
|
14458
|
+
const isSemicircle = Math.abs(arcAngle - Math.PI) < 1e-6;
|
|
14459
|
+
const numPoints = isSemicircle ? minNumPoints + minNumPoints % 2 : minNumPoints;
|
|
14467
14460
|
const path = [];
|
|
14468
14461
|
for (let i = 0; i <= numPoints; i++) {
|
|
14469
14462
|
const t = i / numPoints;
|