Fixing label positioning in subexp nodes
This commit is contained in:
parent
27a23162b4
commit
e26d91bae5
@ -29,8 +29,7 @@ export default _.extend({}, Base, {
|
||||
ry: 3
|
||||
});
|
||||
|
||||
this.regexp.container = this.container.group().transform(Snap.matrix()
|
||||
.translate(10, 10));
|
||||
this.regexp.container = this.container.group();
|
||||
this.regexp.render();
|
||||
} else {
|
||||
this.regexp.container = this.container;
|
||||
@ -44,9 +43,20 @@ export default _.extend({}, Base, {
|
||||
this.regexp.position();
|
||||
|
||||
if (this.outline) {
|
||||
box = this.label.getBBox();
|
||||
|
||||
this.label.transform(Snap.matrix()
|
||||
.translate(0, box.height));
|
||||
|
||||
this.regexp.container.transform(Snap.matrix()
|
||||
.translate(10, 10 + box.height));
|
||||
|
||||
box = this.regexp.getBBox();
|
||||
|
||||
this.outline.attr({
|
||||
this.outline
|
||||
.transform(Snap.matrix()
|
||||
.translate(box.x - 10, box.y - 10))
|
||||
.attr({
|
||||
width: box.width + 20,
|
||||
height: box.height + 20
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user