From e574711585cbb9ccbd5dc615d808c1203d0ea61c Mon Sep 17 00:00:00 2001 From: Christian Dinkel Date: Tue, 21 Nov 2023 10:24:09 +0100 Subject: [PATCH] fix: move equipment into bus bar --- sld-editor.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sld-editor.ts b/sld-editor.ts index 8848363..70358ab 100644 --- a/sld-editor.ts +++ b/sld-editor.ts @@ -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; } @@ -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(