stuffs
This commit is contained in:
@@ -36,9 +36,9 @@ export default {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
centerX: 1024,
|
||||
centerX: 0,
|
||||
scale: 1,
|
||||
centerY: 140,
|
||||
centerY: 0,
|
||||
nodes: [],
|
||||
links: [],
|
||||
}
|
||||
@@ -125,19 +125,23 @@ export default {
|
||||
})
|
||||
},
|
||||
getPortPosition(type, x, y) {
|
||||
// Line start and end points set here
|
||||
if (type === 'top') {
|
||||
return [x + 40, y];
|
||||
return [x + 100, y];
|
||||
}
|
||||
else if (type === 'bottom') {
|
||||
return [x + 40, y + 80];
|
||||
return [x + 100, y + 150];
|
||||
}
|
||||
},
|
||||
linkingStart(index) {
|
||||
this.action.linking = true;
|
||||
// Dirty fix, so that links won't glitch when being created
|
||||
const node = this.findNodeWithID(index);
|
||||
const [x,y] = this.getPortPosition('bottom',node.x + this.scene.centerX,node.y + this.scene.centerY);
|
||||
this.draggingLink = {
|
||||
from: index,
|
||||
mx: 0,
|
||||
my: 0,
|
||||
mx: x, // Yes, those are magic numbers
|
||||
my: y,
|
||||
};
|
||||
},
|
||||
linkingStop(index) {
|
||||
|
||||
Reference in New Issue
Block a user