mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-06-16 09:20:49 +08:00
Fix switched link position
This commit is contained in:
@@ -59,9 +59,6 @@ export default class KnotNodeTemplate extends NodeTemplate {
|
||||
return result
|
||||
}
|
||||
|
||||
linksChanged() {
|
||||
}
|
||||
|
||||
checkSwtichDirectionsVisually() {
|
||||
let leftPinsLocation = 0
|
||||
let leftPinsCount = 0
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user