@tscircuit/pcb-viewer 1.11.276 → 1.11.277

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 CHANGED
@@ -7094,51 +7094,57 @@ var convertElementToPrimitives = (element, allElements) => {
7094
7094
  ) : void 0;
7095
7095
  switch (element.type) {
7096
7096
  case "pcb_panel": {
7097
- const { width, height } = element;
7097
+ const { width, height, center } = element;
7098
+ const cx = center?.x ?? 0;
7099
+ const cy = center?.y ?? 0;
7098
7100
  return [
7101
+ // Bottom line
7099
7102
  {
7100
7103
  _pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
7101
7104
  pcb_drawing_type: "line",
7102
- x1: 0,
7103
- y1: 0,
7104
- x2: width,
7105
- y2: 0,
7105
+ x1: cx - width / 2,
7106
+ y1: cy - height / 2,
7107
+ x2: cx + width / 2,
7108
+ y2: cy - height / 2,
7106
7109
  width: 1,
7107
7110
  zoomIndependent: true,
7108
7111
  layer: "board",
7109
7112
  _element: element
7110
7113
  },
7114
+ // Top line
7111
7115
  {
7112
7116
  _pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
7113
7117
  pcb_drawing_type: "line",
7114
- x1: 0,
7115
- y1: height,
7116
- x2: width,
7117
- y2: height,
7118
+ x1: cx - width / 2,
7119
+ y1: cy + height / 2,
7120
+ x2: cx + width / 2,
7121
+ y2: cy + height / 2,
7118
7122
  width: 1,
7119
7123
  zoomIndependent: true,
7120
7124
  layer: "board",
7121
7125
  _element: element
7122
7126
  },
7127
+ // Left line
7123
7128
  {
7124
7129
  _pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
7125
7130
  pcb_drawing_type: "line",
7126
- x1: 0,
7127
- y1: 0,
7128
- x2: 0,
7129
- y2: height,
7131
+ x1: cx - width / 2,
7132
+ y1: cy - height / 2,
7133
+ x2: cx - width / 2,
7134
+ y2: cy + height / 2,
7130
7135
  width: 1,
7131
7136
  zoomIndependent: true,
7132
7137
  layer: "board",
7133
7138
  _element: element
7134
7139
  },
7140
+ // Right line
7135
7141
  {
7136
7142
  _pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
7137
7143
  pcb_drawing_type: "line",
7138
- x1: width,
7139
- y1: 0,
7140
- x2: width,
7141
- y2: height,
7144
+ x1: cx + width / 2,
7145
+ y1: cy - height / 2,
7146
+ x2: cx + width / 2,
7147
+ y2: cy + height / 2,
7142
7148
  width: 1,
7143
7149
  zoomIndependent: true,
7144
7150
  layer: "board",
@@ -13305,7 +13311,7 @@ import { css as css3 } from "@emotion/css";
13305
13311
  // package.json
13306
13312
  var package_default = {
13307
13313
  name: "@tscircuit/pcb-viewer",
13308
- version: "1.11.275",
13314
+ version: "1.11.276",
13309
13315
  main: "dist/index.js",
13310
13316
  type: "module",
13311
13317
  repository: "tscircuit/pcb-viewer",
@@ -13342,7 +13348,7 @@ var package_default = {
13342
13348
  "react-cosmos-plugin-vite": "7.0.0-beta.0",
13343
13349
  "react-dom": "19.1.0",
13344
13350
  "react-use": "^17.4.0",
13345
- tscircuit: "^0.0.758",
13351
+ tscircuit: "^0.0.1015",
13346
13352
  tsup: "^8.0.2",
13347
13353
  "type-fest": "^3.0.0",
13348
13354
  typescript: "^5.4.4",