Removing some connecting lines
This is in preparation for properly aligning nodes and simplifying the connecting lines to reduce the number of path elements required.
This commit is contained in:
parent
6ab5b2993b
commit
b13ee3add2
@ -25,7 +25,7 @@ export default _.extend({}, Base, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
position() {
|
position() {
|
||||||
var items, paths;
|
var items;
|
||||||
|
|
||||||
if (this.anchorStart()) {
|
if (this.anchorStart()) {
|
||||||
this.positionLabel(this.contents.anchor_start);
|
this.positionLabel(this.contents.anchor_start);
|
||||||
@ -41,18 +41,6 @@ export default _.extend({}, Base, {
|
|||||||
this.spaceHorizontally(items, {
|
this.spaceHorizontally(items, {
|
||||||
padding: 10
|
padding: 10
|
||||||
});
|
});
|
||||||
|
|
||||||
// NOTE:
|
|
||||||
// item.cy won't work for this in the long run once vertical centers can be
|
|
||||||
// offset.
|
|
||||||
paths = _.map(items, item => {
|
|
||||||
return Snap.format('M{item.x2},{item.cy}h10', {
|
|
||||||
item: item.getBBox()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
paths.pop();
|
|
||||||
|
|
||||||
this.container.prepend(this.container.path(paths.join('')));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
anchorStart() {
|
anchorStart() {
|
||||||
|
@ -32,10 +32,6 @@ export default _.extend({}, Base, {
|
|||||||
}, box)));
|
}, box)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._repeat.hasLoop() || this._repeat.hasSkip()) {
|
|
||||||
paths.push(Snap.format('M0,{cy}h15M{x2},{cy}h15', box));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (paths.length) {
|
if (paths.length) {
|
||||||
this.container.path(paths.join(''));
|
this.container.path(paths.join(''));
|
||||||
}
|
}
|
||||||
|
@ -39,13 +39,13 @@ export default _.extend({}, Base, {
|
|||||||
|
|
||||||
if (distance >= 15) {
|
if (distance >= 15) {
|
||||||
pathStr = [
|
pathStr = [
|
||||||
'M10,{box.cy}m0,{shift}q0,{curve} 10,{curve}h{box.x}',
|
'M10,{box.cy}m0,{shift}q0,{curve} 10,{curve}',
|
||||||
'M{containerBox.width},{box.cy}m30,{shift}q0,{curve} -10,{curve}h-{box.x}'
|
'M{containerBox.width},{box.cy}m30,{shift}q0,{curve} -10,{curve}'
|
||||||
].join('');
|
].join('');
|
||||||
} else {
|
} else {
|
||||||
pathStr = [
|
pathStr = [
|
||||||
'M0,{containerBox.cy}c10,0 10,{anchor.y} {anchor.x},{anchor.y}',
|
'M0,{containerBox.cy}c10,0 10,{anchor.y} 20,{anchor.y}',
|
||||||
'M{containerBox.width},{containerBox.cy}m40,0c-10,0 -10,{anchor.y} -{anchor.x},{anchor.y}'
|
'M{containerBox.width},{containerBox.cy}m40,0c-10,0 -10,{anchor.y} -20,{anchor.y}'
|
||||||
].join('');
|
].join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,10 +24,6 @@ export default _.extend({}, Base, {
|
|||||||
|
|
||||||
contentBox = this.regexp.getBBox();
|
contentBox = this.regexp.getBBox();
|
||||||
|
|
||||||
this.container.prepend(
|
|
||||||
this.container.path(Snap.format('M0,{cy}h10M{x2},{cy}h10', contentBox))
|
|
||||||
);
|
|
||||||
|
|
||||||
this.start.transform(Snap.matrix()
|
this.start.transform(Snap.matrix()
|
||||||
.translate(0, contentBox.cy));
|
.translate(0, contentBox.cy));
|
||||||
this.end.transform(Snap.matrix()
|
this.end.transform(Snap.matrix()
|
||||||
|
@ -60,11 +60,6 @@ export default _.extend({}, Base, {
|
|||||||
width: box.width + 20,
|
width: box.width + 20,
|
||||||
height: box.height + 20
|
height: box.height + 20
|
||||||
});
|
});
|
||||||
|
|
||||||
this.container.path(Snap.format('M0,{content.cy}h10M{content.x2},{content.cy}H{container.x2}', {
|
|
||||||
container: this.getBBox(),
|
|
||||||
content: box
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user