From b13ee3add2692e29f37c743470caac417cb90037 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Wed, 10 Dec 2014 17:09:18 -0500 Subject: [PATCH] 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. --- src/js/parser/javascript/match.js | 14 +------------- src/js/parser/javascript/match_fragment.js | 4 ---- src/js/parser/javascript/regexp.js | 8 ++++---- src/js/parser/javascript/root.js | 4 ---- src/js/parser/javascript/subexp.js | 5 ----- 5 files changed, 5 insertions(+), 30 deletions(-) diff --git a/src/js/parser/javascript/match.js b/src/js/parser/javascript/match.js index ca3ba0f..ab6d2e6 100644 --- a/src/js/parser/javascript/match.js +++ b/src/js/parser/javascript/match.js @@ -25,7 +25,7 @@ export default _.extend({}, Base, { }, position() { - var items, paths; + var items; if (this.anchorStart()) { this.positionLabel(this.contents.anchor_start); @@ -41,18 +41,6 @@ export default _.extend({}, Base, { this.spaceHorizontally(items, { 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() { diff --git a/src/js/parser/javascript/match_fragment.js b/src/js/parser/javascript/match_fragment.js index 8a032c2..f022b61 100644 --- a/src/js/parser/javascript/match_fragment.js +++ b/src/js/parser/javascript/match_fragment.js @@ -32,10 +32,6 @@ export default _.extend({}, Base, { }, box))); } - if (this._repeat.hasLoop() || this._repeat.hasSkip()) { - paths.push(Snap.format('M0,{cy}h15M{x2},{cy}h15', box)); - } - if (paths.length) { this.container.path(paths.join('')); } diff --git a/src/js/parser/javascript/regexp.js b/src/js/parser/javascript/regexp.js index b340c57..0792944 100644 --- a/src/js/parser/javascript/regexp.js +++ b/src/js/parser/javascript/regexp.js @@ -39,13 +39,13 @@ export default _.extend({}, Base, { if (distance >= 15) { pathStr = [ - 'M10,{box.cy}m0,{shift}q0,{curve} 10,{curve}h{box.x}', - 'M{containerBox.width},{box.cy}m30,{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}' ].join(''); } else { pathStr = [ - 'M0,{containerBox.cy}c10,0 10,{anchor.y} {anchor.x},{anchor.y}', - 'M{containerBox.width},{containerBox.cy}m40,0c-10,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} -20,{anchor.y}' ].join(''); } diff --git a/src/js/parser/javascript/root.js b/src/js/parser/javascript/root.js index 2daed9b..8b7806d 100644 --- a/src/js/parser/javascript/root.js +++ b/src/js/parser/javascript/root.js @@ -24,10 +24,6 @@ export default _.extend({}, Base, { contentBox = this.regexp.getBBox(); - this.container.prepend( - this.container.path(Snap.format('M0,{cy}h10M{x2},{cy}h10', contentBox)) - ); - this.start.transform(Snap.matrix() .translate(0, contentBox.cy)); this.end.transform(Snap.matrix() diff --git a/src/js/parser/javascript/subexp.js b/src/js/parser/javascript/subexp.js index afd57c4..94f014d 100644 --- a/src/js/parser/javascript/subexp.js +++ b/src/js/parser/javascript/subexp.js @@ -60,11 +60,6 @@ export default _.extend({}, Base, { width: box.width + 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 - })); } },