Fixing positioning of rendered expression
This commit is contained in:
parent
354f9bc928
commit
4af501b37b
@ -82,8 +82,7 @@ export default class Regexper {
|
|||||||
snap.selectAll('g').remove();
|
snap.selectAll('g').remove();
|
||||||
|
|
||||||
result = parser.parse(expression);
|
result = parser.parse(expression);
|
||||||
result.container = snap.group().transform(Snap.matrix()
|
result.container = snap.group();
|
||||||
.translate(this.padding, this.padding));
|
|
||||||
result.render();
|
result.render();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -95,6 +94,8 @@ export default class Regexper {
|
|||||||
parsed.position();
|
parsed.position();
|
||||||
|
|
||||||
box = parsed.container.getBBox();
|
box = parsed.container.getBBox();
|
||||||
|
parsed.container.transform(Snap.matrix()
|
||||||
|
.translate(this.padding - box.x, this.padding - box.y));
|
||||||
snap.attr({
|
snap.attr({
|
||||||
width: box.width + this.padding * 2,
|
width: box.width + this.padding * 2,
|
||||||
height: box.height + this.padding * 2
|
height: box.height + this.padding * 2
|
||||||
|
Loading…
Reference in New Issue
Block a user