Some minor fixes and refactoring

This commit is contained in:
barsdeveloper
2025-01-31 00:22:11 +02:00
parent 1073691794
commit 0e2ecdf93e
26 changed files with 290 additions and 87 deletions

View File

@@ -98,8 +98,8 @@ export default class PinElement extends IElement {
this.pinId = this.entity.PinId
this.pinType = this.entity.getType()
this.defaultValue = this.entity.getDefaultValue()
this.color = PinElement.properties.color.converter.fromAttribute(this.getColor().toString())
this.pinDirection = entity.isInput() ? "input" : entity.isOutput() ? "output" : "hidden"
this.updateColor()
}
setup() {
@@ -107,6 +107,10 @@ export default class PinElement extends IElement {
this.nodeElement = this.closest("ueb-node")
}
updateColor() {
this.color = PinElement.properties.color.converter.fromAttribute(this.entity.pinColor().toString())
}
createPinReference() {
return new PinReferenceEntity(new SymbolEntity(this.nodeElement.getNodeName()), this.getPinId())
}
@@ -123,11 +127,6 @@ export default class PinElement extends IElement {
return this.entity.pinTitle()
}
/** @return {CSSResult} */
getColor() {
return this.entity.pinColor()
}
/** @param {PinElement} pin */
#traverseKnots(pin) {
while (pin?.isKnot()) {
@@ -271,8 +270,8 @@ export default class PinElement extends IElement {
}
unlinkFromAll() {
const isLinked = this.getLinks().length
this.getLinks().map(ref => this.blueprint.getPin(ref)).forEach(pin => this.unlinkFrom(pin))
const isLinked = false
}
/**