diff --git a/src/fn/msop.ts b/src/fn/msop.ts
index e0d899c4..9b2beb82 100644
--- a/src/fn/msop.ts
+++ b/src/fn/msop.ts
@@ -60,14 +60,21 @@ export const msop_def = base_def.extend({
string: z.string().optional(),
})
-const getMsopCoords = (pinCount: number, pn: number, w: number, p: number) => {
+const getMsopCoords = (
+ pinCount: number,
+ pn: number,
+ w: number,
+ p: number,
+ pl: number,
+) => {
const half = pinCount / 2
const rowIndex = (pn - 1) % half
const col = pn <= half ? -1 : 1
const row = (half - 1) / 2 - rowIndex
+ const padBodyOverlap = length.parse("0.2mm")
return {
- x: col * length.parse("2mm"),
+ x: col * (w / 2 + pl / 2 - padBodyOverlap),
y: row * p,
}
}
@@ -87,7 +94,7 @@ export const msop = (
const pads: AnyCircuitElement[] = []
for (let i = 0; i < parameters.num_pins; i++) {
- const { x, y } = getMsopCoords(parameters.num_pins, i + 1, w, p)
+ const { x, y } = getMsopCoords(parameters.num_pins, i + 1, w, p, pl)
pads.push(rectpad(i + 1, x, y, pl, pw))
}
@@ -123,6 +130,7 @@ export const msop = (
1,
silkscreenBoxWidth,
p,
+ pl,
)
const pin1MarkerPosition = {
diff --git a/tests/__snapshots__/msop10.snap.svg b/tests/__snapshots__/msop10.snap.svg
index 3d4ae5c8..69a438db 100644
--- a/tests/__snapshots__/msop10.snap.svg
+++ b/tests/__snapshots__/msop10.snap.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tests/__snapshots__/msop12.snap.svg b/tests/__snapshots__/msop12.snap.svg
index baa22fe9..431c5411 100644
--- a/tests/__snapshots__/msop12.snap.svg
+++ b/tests/__snapshots__/msop12.snap.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tests/__snapshots__/msop16.snap.svg b/tests/__snapshots__/msop16.snap.svg
index c375f839..feba39fa 100644
--- a/tests/__snapshots__/msop16.snap.svg
+++ b/tests/__snapshots__/msop16.snap.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tests/__snapshots__/msop8.snap.svg b/tests/__snapshots__/msop8.snap.svg
index 9abfb583..e096a7fc 100644
--- a/tests/__snapshots__/msop8.snap.svg
+++ b/tests/__snapshots__/msop8.snap.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tests/__snapshots__/msop8_h3.32mm_pl1.63mm_pw0.4mm_p0.8mm.snap.svg b/tests/__snapshots__/msop8_h3.32mm_pl1.63mm_pw0.4mm_p0.8mm.snap.svg
index f7732164..b3831202 100644
--- a/tests/__snapshots__/msop8_h3.32mm_pl1.63mm_pw0.4mm_p0.8mm.snap.svg
+++ b/tests/__snapshots__/msop8_h3.32mm_pl1.63mm_pw0.4mm_p0.8mm.snap.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tests/__snapshots__/msop8_p0.75mm.snap.svg b/tests/__snapshots__/msop8_p0.75mm.snap.svg
index 10dac004..cf91df83 100644
--- a/tests/__snapshots__/msop8_p0.75mm.snap.svg
+++ b/tests/__snapshots__/msop8_p0.75mm.snap.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tests/__snapshots__/msop8_w3.10mm_h3.32mm_p0.65mm.snap.svg b/tests/__snapshots__/msop8_w3.10mm_h3.32mm_p0.65mm.snap.svg
index 9abfb583..e096a7fc 100644
--- a/tests/__snapshots__/msop8_w3.10mm_h3.32mm_p0.65mm.snap.svg
+++ b/tests/__snapshots__/msop8_w3.10mm_h3.32mm_p0.65mm.snap.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tests/kicad-parity/__snapshots__/msop8.snap.svg b/tests/kicad-parity/__snapshots__/msop8.snap.svg
index 697159be..4e9a8ba9 100644
--- a/tests/kicad-parity/__snapshots__/msop8.snap.svg
+++ b/tests/kicad-parity/__snapshots__/msop8.snap.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tests/kicad-parity/__snapshots__/msop8_boolean_difference.snap.svg b/tests/kicad-parity/__snapshots__/msop8_boolean_difference.snap.svg
index eb4a21a5..1de4f10e 100644
--- a/tests/kicad-parity/__snapshots__/msop8_boolean_difference.snap.svg
+++ b/tests/kicad-parity/__snapshots__/msop8_boolean_difference.snap.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file