Skip to content
Snippets Groups Projects
Commit 8be4179a authored by Adam Procter's avatar Adam Procter
Browse files

wip

parent 5fae1f0a
No related branches found
No related tags found
No related merge requests found
...@@ -61,6 +61,7 @@ button.action { ...@@ -61,6 +61,7 @@ button.action {
button:active { button:active {
background-color: #cab6ff; background-color: #cab6ff;
} }
/* FIXME: old code */ /* FIXME: old code */
button.new-link { button.new-link {
position: absolute; position: absolute;
......
...@@ -50,9 +50,43 @@ export default { ...@@ -50,9 +50,43 @@ export default {
} }
}, },
makeConnection() {
// var i
// var j
// for (i = 0; i < Object.keys(this.myNodes).length; i++) {
// for (j = 0; j < Object.keys(this.configPositions).length; j++) {
// if (this.configPositions[j].node_id == this.myNodes[i].node_id) {
// console.log(this.myNodes[i].node_id)
// }
// }
// }
// if (this.connectionstate == false) {
// fromnode = id
// xposstart = xpos
// yposstart = ypos
// //count = 1
// this.$store.dispatch('connectionState', true)
// } else if (this.connectionstate == true) {
// tonode = id
// xposend = xpos
// yposend = ypos
// // count = 0
// this.$store.dispatch('connectionState', false)
// this.$store.dispatch('makeConnect', {
// fromnode,
// tonode,
// xposstart,
// yposstart,
// xposend,
// yposend,
// })
// }
},
buttonsDraw() { buttonsDraw() {
var i var i
var j var j
var ref = this
this.canvas = this.$refs.pixi this.canvas = this.$refs.pixi
const stage = this.PIXIApp.stage const stage = this.PIXIApp.stage
let buttons = new PIXI.Graphics() let buttons = new PIXI.Graphics()
...@@ -70,6 +104,8 @@ export default { ...@@ -70,6 +104,8 @@ export default {
15 15
) )
buttons.endFill() buttons.endFill()
// names it the last one only?
buttons.name = this.myNodes[i].node_id
} }
} }
} }
...@@ -86,6 +122,8 @@ export default { ...@@ -86,6 +122,8 @@ export default {
15 15
) )
buttons.endFill() buttons.endFill()
// names it the last one only
buttons.name = this.otherNodes[i].node_id
} }
} }
} }
...@@ -99,16 +137,21 @@ export default { ...@@ -99,16 +137,21 @@ export default {
buttons buttons
.on('pointerdown', onDragStart) .on('pointerdown', onDragStart)
.on('pointerdown', start)
.on('pointerup', onDragEnd) .on('pointerup', onDragEnd)
.on('pointerupoutside', onDragEnd) .on('pointerupoutside', onDragEnd)
.on('pointermove', onDragMove) .on('pointermove', onDragMove)
let lines = [] let lines = []
function start() {
ref.makeConnection()
}
function onDragStart(event) { function onDragStart(event) {
console.log(event)
this.dragging = true this.dragging = true
// returns on the last one in the loop
console.log(this.name)
let mouseX = event.data.global.x let mouseX = event.data.global.x
let mouseY = event.data.global.y let mouseY = event.data.global.y
...@@ -123,6 +166,7 @@ export default { ...@@ -123,6 +166,7 @@ export default {
} }
function onDragEnd() { function onDragEnd() {
// console.log(this.name)
this.dragging = false this.dragging = false
stage.removeChild(line) stage.removeChild(line)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment