mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-06 10:47:30 +08:00
More knots fixes
This commit is contained in:
6
dist/ueblueprint.js
vendored
6
dist/ueblueprint.js
vendored
@@ -7671,6 +7671,8 @@ class LinkTemplate extends IFromToPositionedTemplate {
|
|||||||
this.blueprint.addGraphElement(knot); // Important: keep it before changing existing links
|
this.blueprint.addGraphElement(knot); // Important: keep it before changing existing links
|
||||||
const inputPin = this.element.getInputPin();
|
const inputPin = this.element.getInputPin();
|
||||||
const outputPin = this.element.getOutputPin();
|
const outputPin = this.element.getOutputPin();
|
||||||
|
this.element.origin = null;
|
||||||
|
this.element.target = null;
|
||||||
const link = /** @type {LinkElementConstructor} */(ElementFactory.getConstructor("ueb-link"))
|
const link = /** @type {LinkElementConstructor} */(ElementFactory.getConstructor("ueb-link"))
|
||||||
.newObject(outputPin, knotTemplate.inputPin);
|
.newObject(outputPin, knotTemplate.inputPin);
|
||||||
this.blueprint.addGraphElement(link);
|
this.blueprint.addGraphElement(link);
|
||||||
@@ -7689,9 +7691,9 @@ class LinkTemplate extends IFromToPositionedTemplate {
|
|||||||
|
|
||||||
// Switch actual input/output pins if allowed and makes sense
|
// Switch actual input/output pins if allowed and makes sense
|
||||||
if (isOriginAKnot && !targetPin) {
|
if (isOriginAKnot && !targetPin) {
|
||||||
if (originPin?.isInputLoosely() && to > from + Configuration.distanceThreshold) {
|
if (originPin?.isInput() && to > from + Configuration.distanceThreshold) {
|
||||||
this.element.origin = /** @type {KnotPinTemplate} */(originPin.template).getoppositePin();
|
this.element.origin = /** @type {KnotPinTemplate} */(originPin.template).getoppositePin();
|
||||||
} else if (originPin?.isOutputLoosely() && to < from - Configuration.distanceThreshold) {
|
} else if (originPin?.isOutput() && to < from - Configuration.distanceThreshold) {
|
||||||
this.element.origin = /** @type {KnotPinTemplate} */(originPin.template).getoppositePin();
|
this.element.origin = /** @type {KnotPinTemplate} */(originPin.template).getoppositePin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
dist/ueblueprint.min.js
vendored
2
dist/ueblueprint.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -52,6 +52,8 @@ export default class LinkTemplate extends IFromToPositionedTemplate {
|
|||||||
this.blueprint.addGraphElement(knot) // Important: keep it before changing existing links
|
this.blueprint.addGraphElement(knot) // Important: keep it before changing existing links
|
||||||
const inputPin = this.element.getInputPin()
|
const inputPin = this.element.getInputPin()
|
||||||
const outputPin = this.element.getOutputPin()
|
const outputPin = this.element.getOutputPin()
|
||||||
|
this.element.origin = null
|
||||||
|
this.element.target = null
|
||||||
const link = /** @type {LinkElementConstructor} */(ElementFactory.getConstructor("ueb-link"))
|
const link = /** @type {LinkElementConstructor} */(ElementFactory.getConstructor("ueb-link"))
|
||||||
.newObject(outputPin, knotTemplate.inputPin)
|
.newObject(outputPin, knotTemplate.inputPin)
|
||||||
this.blueprint.addGraphElement(link)
|
this.blueprint.addGraphElement(link)
|
||||||
@@ -70,9 +72,9 @@ export default class LinkTemplate extends IFromToPositionedTemplate {
|
|||||||
|
|
||||||
// Switch actual input/output pins if allowed and makes sense
|
// Switch actual input/output pins if allowed and makes sense
|
||||||
if (isOriginAKnot && !targetPin) {
|
if (isOriginAKnot && !targetPin) {
|
||||||
if (originPin?.isInputLoosely() && to > from + Configuration.distanceThreshold) {
|
if (originPin?.isInput() && to > from + Configuration.distanceThreshold) {
|
||||||
this.element.origin = /** @type {KnotPinTemplate} */(originPin.template).getoppositePin()
|
this.element.origin = /** @type {KnotPinTemplate} */(originPin.template).getoppositePin()
|
||||||
} else if (originPin?.isOutputLoosely() && to < from - Configuration.distanceThreshold) {
|
} else if (originPin?.isOutput() && to < from - Configuration.distanceThreshold) {
|
||||||
this.element.origin = /** @type {KnotPinTemplate} */(originPin.template).getoppositePin()
|
this.element.origin = /** @type {KnotPinTemplate} */(originPin.template).getoppositePin()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user