@tscircuit/pcb-viewer 1.11.231 → 1.11.232
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/index.js +42 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -11713,6 +11713,46 @@ var PcbGroupOverlay = ({
|
|
|
11713
11713
|
ctx.textAlign = "left";
|
|
11714
11714
|
ctx.textBaseline = "middle";
|
|
11715
11715
|
ctx.fillText(labelText, labelX + labelPadding, labelY - labelHeight / 2);
|
|
11716
|
+
if (group.anchor_position) {
|
|
11717
|
+
const anchor = group.anchor_position;
|
|
11718
|
+
const groupLeft = minX;
|
|
11719
|
+
const groupRight = maxX;
|
|
11720
|
+
const groupTop = maxY;
|
|
11721
|
+
const groupBottom = minY;
|
|
11722
|
+
let edgePoint = { x: anchor.x, y: anchor.y };
|
|
11723
|
+
const distToLeft = Math.abs(anchor.x - groupLeft);
|
|
11724
|
+
const distToRight = Math.abs(anchor.x - groupRight);
|
|
11725
|
+
const distToTop = Math.abs(anchor.y - groupTop);
|
|
11726
|
+
const distToBottom = Math.abs(anchor.y - groupBottom);
|
|
11727
|
+
const minDist = Math.min(
|
|
11728
|
+
distToLeft,
|
|
11729
|
+
distToRight,
|
|
11730
|
+
distToTop,
|
|
11731
|
+
distToBottom
|
|
11732
|
+
);
|
|
11733
|
+
if (minDist === distToLeft) {
|
|
11734
|
+
edgePoint = { x: groupLeft, y: anchor.y };
|
|
11735
|
+
} else if (minDist === distToRight) {
|
|
11736
|
+
edgePoint = { x: groupRight, y: anchor.y };
|
|
11737
|
+
} else if (minDist === distToTop) {
|
|
11738
|
+
edgePoint = { x: anchor.x, y: groupTop };
|
|
11739
|
+
} else {
|
|
11740
|
+
edgePoint = { x: anchor.x, y: groupBottom };
|
|
11741
|
+
}
|
|
11742
|
+
const anchorScreenPos = applyToPoint13(transform, edgePoint);
|
|
11743
|
+
ctx.strokeStyle = "white";
|
|
11744
|
+
ctx.lineWidth = 1.5;
|
|
11745
|
+
ctx.setLineDash([]);
|
|
11746
|
+
const plusSize = Math.max(4, Math.min(8, 6 * Math.abs(transform.a)));
|
|
11747
|
+
ctx.beginPath();
|
|
11748
|
+
ctx.moveTo(anchorScreenPos.x - plusSize, anchorScreenPos.y);
|
|
11749
|
+
ctx.lineTo(anchorScreenPos.x + plusSize, anchorScreenPos.y);
|
|
11750
|
+
ctx.stroke();
|
|
11751
|
+
ctx.beginPath();
|
|
11752
|
+
ctx.moveTo(anchorScreenPos.x, anchorScreenPos.y - plusSize);
|
|
11753
|
+
ctx.lineTo(anchorScreenPos.x, anchorScreenPos.y + plusSize);
|
|
11754
|
+
ctx.stroke();
|
|
11755
|
+
}
|
|
11716
11756
|
});
|
|
11717
11757
|
}, [
|
|
11718
11758
|
elements,
|
|
@@ -11863,7 +11903,7 @@ import { css as css3 } from "@emotion/css";
|
|
|
11863
11903
|
// package.json
|
|
11864
11904
|
var package_default = {
|
|
11865
11905
|
name: "@tscircuit/pcb-viewer",
|
|
11866
|
-
version: "1.11.
|
|
11906
|
+
version: "1.11.231",
|
|
11867
11907
|
main: "dist/index.js",
|
|
11868
11908
|
type: "module",
|
|
11869
11909
|
repository: "tscircuit/pcb-viewer",
|
|
@@ -11914,7 +11954,7 @@ var package_default = {
|
|
|
11914
11954
|
dependencies: {
|
|
11915
11955
|
"@emotion/css": "^11.11.2",
|
|
11916
11956
|
"@vitejs/plugin-react": "^5.0.2",
|
|
11917
|
-
"circuit-json": "^0.0.
|
|
11957
|
+
"circuit-json": "^0.0.280",
|
|
11918
11958
|
"circuit-to-svg": "^0.0.240",
|
|
11919
11959
|
color: "^4.2.3",
|
|
11920
11960
|
"react-supergrid": "^1.0.10",
|