Simplifying positioning code for root nodes

This commit is contained in:
Jeff Avallone 2014-12-14 17:48:23 -05:00
parent 97b816ffc9
commit 46ab0662f5

View File

@ -13,19 +13,9 @@ export default _.extend({}, Base, {
.attr({ r: 5 }); .attr({ r: 5 });
return this.regexp.render(this.container.group()) return this.regexp.render(this.container.group())
.then((() => { .then(this.spaceHorizontally.bind(this, [this.start, this.regexp, this.end], {
var contentBox; padding: 10
}));
this.regexp.transform(Snap.matrix()
.translate(10, 0));
contentBox = this.regexp.getBBox();
this.start.transform(Snap.matrix()
.translate(0, contentBox.cy));
this.end.transform(Snap.matrix()
.translate(contentBox.x2 + 10, contentBox.cy));
}).bind(this));
}, },
flags() { flags() {