From 975780609d1c1aae0ecc19875afc47615c2f2989 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Tue, 9 Dec 2014 21:00:36 -0500 Subject: [PATCH] Fixing label positioning in charset nodes --- src/js/parser/javascript/charset.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/js/parser/javascript/charset.js b/src/js/parser/javascript/charset.js index 2ff3616..0efb649 100644 --- a/src/js/parser/javascript/charset.js +++ b/src/js/parser/javascript/charset.js @@ -37,15 +37,23 @@ export default _.extend({}, Base, { padding: 5 }); + box = this.label.getBBox(); + + this.label.transform(Snap.matrix() + .translate(0, box.height)); + + this.partContainer.transform(Snap.matrix() + .translate(5, 5 + box.height)); + + this.box.transform(Snap.matrix() + .translate(0, box.height)); + box = this.partContainer.getBBox(); this.box.attr({ width: box.width + 10, height: box.height + 10 }); - - this.partContainer.transform(Snap.matrix() - .translate(5, 5)); }, invert() {