diff --git a/src/js/parser/javascript/regexp.js b/src/js/parser/javascript/regexp.js index 429b082..c2eda4a 100644 --- a/src/js/parser/javascript/regexp.js +++ b/src/js/parser/javascript/regexp.js @@ -40,9 +40,15 @@ export default _.extend({}, Base, { pathStr; if (distance >= 15) { - pathStr = 'M10,{box.cy}m0,{shift}q0,{curve} 10,{curve}h{box.x}'; + 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}' + ].join(''); } else { - pathStr = 'M0,{containerBox.cy}c10,0 10,{anchor.y} {anchor.x},{anchor.y}'; + 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}' + ].join(''); } return Snap.format(pathStr, { @@ -57,15 +63,18 @@ export default _.extend({}, Base, { }); }); - paths.push(Snap.format('M0,{box.cy}q10,0 10,-10V{top}M0,{box.cy}q10,0 10,10V{bottom}', { + paths.push(Snap.format([ + 'M0,{box.cy}q10,0 10,-10V{top}', + 'M0,{box.cy}q10,0 10,10V{bottom}', + 'M{box.width},{box.cy}m40,0q-10,0 -10,-10V{top}', + 'M{box.width},{box.cy}m40,0q-10,0 -10,10V{bottom}' + ].join(''), { box: containerBox, top: _.first(matches).getBBox().cy + 10, bottom: _.last(matches).getBBox().cy - 10 })); this.container.prepend(this.container.path(paths.join(''))); - this.container.prepend(this.container.path(paths.join('')) - .transform(Snap.matrix().scale(-1, 1, containerBox.cx - 10, 0))); } },