Skip to content

Commit

Permalink
fix: move equipment into bus bar
Browse files Browse the repository at this point in the history
  • Loading branch information
ca-d committed Nov 21, 2023
1 parent 4132db7 commit e574711
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sld-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ export class SLDEditor extends LitElement {
? containsRect(this.substation, x, y, w, h)
: Array.from(
this.substation.querySelectorAll(parentTags[element.tagName]!)
).find(parent => containsRect(parent, x, y, w, h));
).find(
parent => !isBusBar(parent) && containsRect(parent, x, y, w, h)
);
if (containingParent) return true;
return false;
}
Expand Down Expand Up @@ -1353,7 +1355,7 @@ export class SLDEditor extends LitElement {
this.substation.querySelectorAll(
':root > Substation > VoltageLevel > Bay'
)
).find(vl => containsRect(vl, x, y, 1, 1));
).find(bay => !isBusBar(bay) && containsRect(bay, x, y, 1, 1));
if (parent && this.canPlaceAt(equipment, x, y, 1, 1))
handleClick = () => {
this.dispatchEvent(
Expand Down

0 comments on commit e574711

Please sign in to comment.