Link implementation wip

This commit is contained in:
barsdeveloper
2022-01-18 21:21:45 +01:00
parent ce5b184b3d
commit e90277826d
19 changed files with 580 additions and 454 deletions

View File

@@ -1,7 +1,6 @@
import GraphElement from "./GraphElement"
import PinTemplate from "../template/PinTemplate"
import MouseCreateLink from "../input/mouse/MouseCreateLink"
import GraphLink from "./GraphLink"
export default class GraphPin extends GraphElement {
@@ -9,6 +8,8 @@ export default class GraphPin extends GraphElement {
super(entity, new PinTemplate())
/** @type {import("../entity/PinEntity").default} */
this.entity
/** @type {PinTemplate} */
this.template
/** @type {HTMLElement} */
this.clickableElement = null
}
@@ -16,7 +17,8 @@ export default class GraphPin extends GraphElement {
createInputObjects() {
return [
new MouseCreateLink(this.clickableElement, this.blueprint, {
moveEverywhere: true
moveEverywhere: true,
looseTarget: true
}),
]
}
@@ -49,15 +51,6 @@ export default class GraphPin extends GraphElement {
return this.entity.getType()
}
/**
*
* @returns {GraphLink} The link created
*/
dragLink() {
let link = new GraphLink(this)
return link
}
/**
* Returns The exact location where the link originates from or arrives at.
* @returns {Number[]} The location array