Skip to content

Commit cdd4962

Browse files
fixed verticallyinverted
1 parent 821dba1 commit cdd4962

8 files changed

Lines changed: 13 additions & 24 deletions

src/helpers/determine-pin-label-anchor-side.ts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,25 @@ type PinlabelAnchorSideParams = {
88
export function determinePinlabelAnchorSide({
99
pinlabeltextalignleft,
1010
pinlabeltextalignright,
11-
pinlabelverticallyinverted,
1211
pinlabelorthogonal,
1312
}: PinlabelAnchorSideParams): "top" | "bottom" | "left" | "right" {
1413
let pinlabelAnchorSide: "top" | "bottom" | "left" | "right" = "top"
1514
// Default to center if no alignment specified
16-
if (pinlabelorthogonal && pinlabelverticallyinverted) {
17-
pinlabelAnchorSide = "left"
18-
} else if (pinlabelorthogonal) {
15+
if (pinlabelorthogonal) {
1916
pinlabelAnchorSide = "right"
20-
} else if (pinlabelverticallyinverted) {
21-
pinlabelAnchorSide = "bottom"
2217
} else {
2318
pinlabelAnchorSide = "top"
2419
}
2520
if (pinlabeltextalignleft) {
26-
if (pinlabelorthogonal && pinlabelverticallyinverted) {
27-
pinlabelAnchorSide = "top"
28-
} else if (pinlabelorthogonal) {
21+
if (pinlabelorthogonal) {
2922
pinlabelAnchorSide = "bottom"
30-
} else if (pinlabelverticallyinverted) {
31-
pinlabelAnchorSide = "left"
3223
} else {
3324
pinlabelAnchorSide = "right"
3425
}
3526
}
3627
if (pinlabeltextalignright) {
37-
if (pinlabelorthogonal && pinlabelverticallyinverted) {
38-
pinlabelAnchorSide = "bottom"
39-
} else if (pinlabelorthogonal) {
28+
if (pinlabelorthogonal) {
4029
pinlabelAnchorSide = "top"
41-
} else if (pinlabelverticallyinverted) {
42-
pinlabelAnchorSide = "right"
4330
} else {
4431
pinlabelAnchorSide = "left"
4532
}

src/helpers/silkscreenPin.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ export const silkscreenPin = ({
3636

3737
let anchor_alignment: PcbSilkscreenText["anchor_alignment"] = "center"
3838
if (textalign === "left") {
39-
anchor_alignment = "center_left"
39+
if (verticallyinverted) anchor_alignment = "center_right"
40+
else anchor_alignment = "center_left"
4041
}
4142
if (textalign === "right") {
42-
anchor_alignment = "center_right"
43+
if (verticallyinverted) anchor_alignment = "center_left"
44+
else anchor_alignment = "center_right"
4345
}
4446

4547
return {
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)