easyeda 0.0.372 → 0.0.374
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 +3 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +4 -3
- 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.373",
|
|
1082
1082
|
files: [
|
|
1083
1083
|
"dist"
|
|
1084
1084
|
],
|
|
@@ -15574,10 +15574,11 @@ function generateArcFromSweep(startX, startY, endX, endY, radius, largeArcFlag,
|
|
|
15574
15574
|
const dx = endX - startX;
|
|
15575
15575
|
const dy = endY - startY;
|
|
15576
15576
|
const distance3 = Math.sqrt(dx * dx + dy * dy);
|
|
15577
|
-
|
|
15577
|
+
const maxRadius = distance3 / 2;
|
|
15578
|
+
if (distance3 === 0 || radius < maxRadius * (1 - 1e-9)) {
|
|
15578
15579
|
return [start, end];
|
|
15579
15580
|
}
|
|
15580
|
-
const h = Math.sqrt(radius * radius - distance3 * distance3 / 4);
|
|
15581
|
+
const h = Math.sqrt(Math.max(0, radius * radius - distance3 * distance3 / 4));
|
|
15581
15582
|
const angle = Math.atan2(dy, dx);
|
|
15582
15583
|
const centerDirection = (sweepFlag ? -1 : 1) * (largeArcFlag ? -1 : 1);
|
|
15583
15584
|
const centerX = midX + h * Math.sin(angle) * centerDirection;
|