mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-27 18:54:44 +08:00
Fix link creation bug
This commit is contained in:
@@ -137,9 +137,10 @@ export default class LinkElement extends IElement {
|
||||
*/
|
||||
setSourcePin(pin) {
|
||||
if (this.#source) {
|
||||
const settings = this.#source.blueprint.settings
|
||||
const nodeElement = this.#source.getNodeElement()
|
||||
nodeElement.removeEventListener(this.blueprint.settings.nodeDeleteEventName, this.#nodeDeleteHandler)
|
||||
nodeElement.removeEventListener(this.blueprint.settings.nodeDragLocalEventName, this.#nodeDragSourceHandler)
|
||||
nodeElement.removeEventListener(settings.nodeDeleteEventName, this.#nodeDeleteHandler)
|
||||
nodeElement.removeEventListener(settings.nodeDragLocalEventName, this.#nodeDragSourceHandler)
|
||||
if (this.#destination) {
|
||||
this.#unlinkPins()
|
||||
}
|
||||
@@ -147,9 +148,10 @@ export default class LinkElement extends IElement {
|
||||
this.#source = pin
|
||||
if (this.#source) {
|
||||
const nodeElement = this.#source.getNodeElement()
|
||||
const settings = this.#source.blueprint.settings
|
||||
this.originatesFromInput = pin.isInput()
|
||||
nodeElement.addEventListener(this.blueprint.settings.nodeDeleteEventName, this.#nodeDeleteHandler)
|
||||
nodeElement.addEventListener(this.blueprint.settings.nodeDragLocalEventName, this.#nodeDragSourceHandler)
|
||||
nodeElement.addEventListener(settings.nodeDeleteEventName, this.#nodeDeleteHandler)
|
||||
nodeElement.addEventListener(settings.nodeDragLocalEventName, this.#nodeDragSourceHandler)
|
||||
this.setSourceLocation()
|
||||
if (this.#destination) {
|
||||
this.#linkPins()
|
||||
|
||||
Reference in New Issue
Block a user