SVGIcon class, Macro reference entity

This commit is contained in:
barsdeveloper
2022-11-16 17:47:11 +01:00
parent 900245d69e
commit 704049c869
29 changed files with 571 additions and 190 deletions

View File

@@ -1,4 +1,5 @@
import { html } from "lit"
import Configuration from "../Configuration"
import ElementFactory from "../element/ElementFactory"
import KnotPinTemplate from "./KnotPinTemplate"
import NodeTemplate from "./NodeTemplate"
@@ -10,6 +11,11 @@ import NodeTemplate from "./NodeTemplate"
export default class KnotNodeTemplate extends NodeTemplate {
static #traversedPin = new Set()
/** @type {Boolean?} */
#chainDirection = null // The node is part of a chain connected to an input or output pin
/** @type {PinElement} */
#inputPin
get inputPin() {
@@ -22,6 +28,24 @@ export default class KnotNodeTemplate extends NodeTemplate {
return this.#outputPin
}
/** @param {PinElement} startingPin */
findDirectionaPin(startingPin) {
if (
startingPin.nodeElement.getType() !== Configuration.nodeType.knot
|| KnotNodeTemplate.#traversedPin.has(startingPin)
) {
KnotNodeTemplate.#traversedPin.clear()
return true
}
KnotNodeTemplate.#traversedPin.add(startingPin)
for (let pin of startingPin.getLinks().map(l => this.element.blueprint.getPin(l))) {
if (this.findDirectionaPin(pin)) {
return true
}
}
return false
}
render() {
return html`
<div class="ueb-node-border"></div>
@@ -60,4 +84,8 @@ export default class KnotNodeTemplate extends NodeTemplate {
)),
]
}
linksChanged() {
}
}