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/browser/index.js
CHANGED
|
@@ -18269,22 +18269,15 @@ function generateArcFromSweep(startX, startY, endX, endY, radius, largeArcFlag,
|
|
|
18269
18269
|
const centerY = midY - h * Math.cos(angle) * centerDirection;
|
|
18270
18270
|
const startAngle = Math.atan2(startY - centerY, startX - centerX);
|
|
18271
18271
|
let endAngle = Math.atan2(endY - centerY, endX - centerX);
|
|
18272
|
-
if (sweepFlag && endAngle
|
|
18273
|
-
endAngle -= 2 * Math.PI;
|
|
18274
|
-
} else if (!sweepFlag && endAngle < startAngle) {
|
|
18272
|
+
if (sweepFlag && endAngle < startAngle) {
|
|
18275
18273
|
endAngle += 2 * Math.PI;
|
|
18274
|
+
} else if (!sweepFlag && endAngle > startAngle) {
|
|
18275
|
+
endAngle -= 2 * Math.PI;
|
|
18276
18276
|
}
|
|
18277
|
-
|
|
18278
|
-
|
|
18279
|
-
|
|
18280
|
-
|
|
18281
|
-
endAngle += 2 * Math.PI;
|
|
18282
|
-
}
|
|
18283
|
-
}
|
|
18284
|
-
const numPoints = Math.max(
|
|
18285
|
-
2,
|
|
18286
|
-
Math.ceil(Math.abs(endAngle - startAngle) * radius)
|
|
18287
|
-
);
|
|
18277
|
+
const arcAngle = Math.abs(endAngle - startAngle);
|
|
18278
|
+
const minNumPoints = Math.max(2, Math.ceil(arcAngle * radius));
|
|
18279
|
+
const isSemicircle = Math.abs(arcAngle - Math.PI) < 1e-6;
|
|
18280
|
+
const numPoints = isSemicircle ? minNumPoints + minNumPoints % 2 : minNumPoints;
|
|
18288
18281
|
const path = [];
|
|
18289
18282
|
for (let i = 0; i <= numPoints; i++) {
|
|
18290
18283
|
const t = i / numPoints;
|