mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-12 11:07:40 +08:00
Past nodes fixed, codestyle
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user