Past nodes fixed, codestyle

This commit is contained in:
barsdeveloper
2021-11-07 21:41:40 +01:00
parent afa27bf42c
commit ad8c34cdab
20 changed files with 283 additions and 192 deletions

View File

@@ -1,7 +1,7 @@
import ObjectEntity from "../entity/ObjectEntity"
import SerializerFactory from "../serialization/SerializerFactory"
import NodeTemplate from "../template/NodeTemplate"
import ObjectEntity from "../entity/ObjectEntity"
import SelectableDraggable from "./SelectableDraggable"
import SerializerFactory from "../serialization/SerializerFactory"
export default class GraphNode extends SelectableDraggable {
@@ -10,11 +10,16 @@ export default class GraphNode extends SelectableDraggable {
return new GraphNode(entity)
}
/**
*
* @param {ObjectEntity} entity
*/
constructor(entity) {
super(entity, new NodeTemplate())
this.graphNodeName = 'n/a'
this.inputs = []
this.outputs = []
super.setLocation([this.entity.NodePosX, this.entity.NodePosY])
}
connectedCallback() {
@@ -27,6 +32,12 @@ export default class GraphNode extends SelectableDraggable {
this.style.setProperty('--ueb-position-x', this.location[0])
this.style.setProperty('--ueb-position-y', this.location[1])
}
setLocation(value = [0, 0]) {
this.entity.NodePosX = value[0]
this.entity.NodePosY = value[1]
super.setLocation(value)
}
}
customElements.define('u-node', GraphNode)