Fixing positioning of rendered expression

This commit is contained in:
Jeff Avallone 2014-12-05 23:06:02 -05:00
parent 354f9bc928
commit 4af501b37b

View File

@ -82,8 +82,7 @@ export default class Regexper {
snap.selectAll('g').remove();
result = parser.parse(expression);
result.container = snap.group().transform(Snap.matrix()
.translate(this.padding, this.padding));
result.container = snap.group();
result.render();
return result;
@ -95,6 +94,8 @@ export default class Regexper {
parsed.position();
box = parsed.container.getBBox();
parsed.container.transform(Snap.matrix()
.translate(this.padding - box.x, this.padding - box.y));
snap.attr({
width: box.width + this.padding * 2,
height: box.height + this.padding * 2