Fix switched link position

This commit is contained in:
barsdeveloper
2025-01-25 14:52:54 +02:00
parent 1d9a88125e
commit 41988b1599
7 changed files with 17 additions and 37 deletions

View File

@@ -59,9 +59,6 @@ export default class KnotNodeTemplate extends NodeTemplate {
return result
}
linksChanged() {
}
checkSwtichDirectionsVisually() {
let leftPinsLocation = 0
let leftPinsCount = 0

View File

@@ -169,8 +169,6 @@ export default class NodeTemplate extends ISelectableDraggableTemplate {
.map(pinEntity => this.createPinElement(pinEntity))
}
linksChanged() { }
/** All the link connected to this node */
getAllConnectedLinks() {
const nodeTitle = this.element.nodeTitle

View File

@@ -14,10 +14,10 @@ export default class KnotPinTemplate extends MinimalPinTemplate {
}
/** Location on the grid of a link connecting to this pin */
getLinkLocation() {
getLinkLocation(oppositeDirection = false) {
if (this.element.isInput()) {
return this.getoppositePin().getLinkLocation()
return this.getoppositePin().getLinkLocation(!oppositeDirection)
}
return super.getLinkLocation()
return super.getLinkLocation(oppositeDirection)
}
}

View File

@@ -171,11 +171,11 @@ export default class PinTemplate extends ITemplate {
this.#wrapperElement = this.element.querySelector(".ueb-pin-wrapper")
}
getLinkLocation() {
getLinkLocation(oppositeDirection = false) {
const rect = (this.#iconElement ?? this.element).getBoundingClientRect()
/** @type {[Number, Number]} */
const boundingLocation = [
this.element.isInputVisually() ? rect.left : rect.right + 1,
this.element.isInputVisually() && !oppositeDirection ? rect.left : rect.right + 1,
(rect.top + rect.bottom) / 2
]
const location = Utility.convertLocation(boundingLocation, this.blueprint.template.gridElement)