Minor refactoring

This commit is contained in:
barsdeveloper
2025-01-25 01:41:32 +02:00
parent dfa402707c
commit 1d9a88125e
13 changed files with 176 additions and 104 deletions

View File

@@ -8,14 +8,15 @@ export default class KnotPinTemplate extends MinimalPinTemplate {
return this.element.isOutput() ? super.render() : html``
}
oppositePin() {
getoppositePin() {
const nodeTemplate = /** @type {KnotNodeTemplate} */(this.element.nodeElement.template)
return this.element.isOutput() ? nodeTemplate.inputPin : nodeTemplate.outputPin
}
/** Location on the grid of a link connecting to this pin */
getLinkLocation() {
if (this.element.isInput()) {
return this.oppositePin().getLinkLocation()
return this.getoppositePin().getLinkLocation()
}
return super.getLinkLocation()
}