Skip to content

Commit

Permalink
Copy schematic sheet pin's position during painting to avoid repeated…
Browse files Browse the repository at this point in the history
… modifications. Fixes #19.
  • Loading branch information
theacodes committed Oct 29, 2023
1 parent 6d537c3 commit a3cbcb1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/kicad/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ export class At {
this.unlocked = parsed.unlocked ?? this.unlocked;
}
}

copy() {
const at = new At();
at.position = this.position.copy();
at.rotation = this.rotation;
at.unlocked = this.unlocked;
return at;
}
}

export const PaperSize = {
Expand Down
2 changes: 1 addition & 1 deletion src/viewers/schematic/painter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ class SchematicSheetPainter extends SchematicItemPainter {
if (layer.name == LayerNames.label) {
for (const pin of ss.pins) {
const label = new schematic_items.HierarchicalLabel();
label.at = pin.at;
label.at = pin.at.copy();
label.effects = pin.effects;
label.text = pin.name;
label.shape = pin.shape;
Expand Down

0 comments on commit a3cbcb1

Please sign in to comment.