mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-18 11:37:33 +08:00
Fix Export paths name adjustments
This commit is contained in:
@@ -122,22 +122,20 @@ export default class LinkTemplate extends IFromToPositionedTemplate {
|
||||
if (changedProperties.has("fromX") || changedProperties.has("toX")) {
|
||||
const from = this.element.fromX
|
||||
const to = this.element.toX
|
||||
const isSourceAKnot = sourcePin?.nodeElement.getType() == Configuration.paths.knot
|
||||
const isDestinationAKnot = destinationPin?.nodeElement.getType() == Configuration.paths.knot
|
||||
const isSourceAKnot = sourcePin?.isKnot()
|
||||
const isDestinationAKnot = destinationPin?.isKnot()
|
||||
if (isSourceAKnot && (!destinationPin || isDestinationAKnot)) {
|
||||
if (sourcePin?.isInput() && to > from + Configuration.distanceThreshold) {
|
||||
this.element.source = /** @type {KnotNodeTemplate} */(sourcePin.nodeElement.template).outputPin
|
||||
} else if (sourcePin?.isOutput() && to < from - Configuration.distanceThreshold) {
|
||||
this.element.source = /** @type {KnotNodeTemplate} */(sourcePin.nodeElement.template).inputPin
|
||||
if (sourcePin?.isInputLoossly() && to > from + Configuration.distanceThreshold) {
|
||||
this.element.source = /** @type {KnotPinTemplate} */(sourcePin.template).oppositePin()
|
||||
} else if (sourcePin?.isOutputLoosely() && to < from - Configuration.distanceThreshold) {
|
||||
this.element.source = /** @type {KnotPinTemplate} */(sourcePin.template).oppositePin()
|
||||
}
|
||||
}
|
||||
if (isDestinationAKnot && (!sourcePin || isSourceAKnot)) {
|
||||
if (destinationPin?.isInput() && to < from - Configuration.distanceThreshold) {
|
||||
this.element.destination =
|
||||
/** @type {KnotNodeTemplate} */(destinationPin.nodeElement.template).outputPin
|
||||
} else if (destinationPin?.isOutput() && to > from + Configuration.distanceThreshold) {
|
||||
this.element.destination =
|
||||
/** @type {KnotNodeTemplate} */(destinationPin.nodeElement.template).inputPin
|
||||
if (destinationPin?.isInputLoossly() && to < from - Configuration.distanceThreshold) {
|
||||
this.element.destination = /** @type {KnotPinTemplate} */(destinationPin.template).oppositePin()
|
||||
} else if (destinationPin?.isOutputLoosely() && to > from + Configuration.distanceThreshold) {
|
||||
this.element.destination = /** @type {KnotPinTemplate} */(destinationPin.template).oppositePin()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,10 +31,7 @@ export default class KnotNodeTemplate extends NodeTemplate {
|
||||
|
||||
/** @param {PinElement} startingPin */
|
||||
findDirectionaPin(startingPin) {
|
||||
if (
|
||||
startingPin.nodeElement.getType() !== Configuration.paths.knot
|
||||
|| KnotNodeTemplate.#traversedPin.has(startingPin)
|
||||
) {
|
||||
if (startingPin.isKnot() || KnotNodeTemplate.#traversedPin.has(startingPin)) {
|
||||
KnotNodeTemplate.#traversedPin.clear()
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ export default class KnotPinTemplate extends MinimalPinTemplate {
|
||||
return this.element.isOutput() ? super.render() : html``
|
||||
}
|
||||
|
||||
getOppositePin() {
|
||||
oppositePin() {
|
||||
const nodeTemplate = /** @type {KnotNodeTemplate} */(this.element.nodeElement.template)
|
||||
return this.element.isOutput() ? nodeTemplate.inputPin : nodeTemplate.outputPin
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user