Cleanup of charset rendering code

This commit is contained in:
Jeff Avallone 2014-12-09 17:48:44 -05:00
parent 3bbd55c36a
commit 0cb090bc10

View File

@ -10,9 +10,7 @@ export default _.extend({}, Base, {
this.label = this.container.text() this.label = this.container.text()
.attr({ .attr({
text: this.invert() ? 'None of:' : 'One of:' text: this.invert() ? 'None of:' : 'One of:'
}) });
.transform(Snap.matrix()
.translate(0, 0));
this.box = this.container.rect() this.box = this.container.rect()
.addClass('charset-box') .addClass('charset-box')
@ -23,7 +21,7 @@ export default _.extend({}, Base, {
this.partContainer = this.container.group(); this.partContainer = this.container.group();
_.each(this.parts.elements, ((part) => { _.each(this.parts.elements, (part => {
part.container = this.partContainer.group(); part.container = this.partContainer.group();
part.render(); part.render();
}).bind(this)); }).bind(this));
@ -32,7 +30,7 @@ export default _.extend({}, Base, {
position() { position() {
var box, offset = 0; var box, offset = 0;
_.each(this.parts.elements, ((part) => { _.each(this.parts.elements, (part => {
var box; var box;
part.position(); part.position();
@ -47,7 +45,7 @@ export default _.extend({}, Base, {
box = this.partContainer.getBBox(); box = this.partContainer.getBBox();
_.each(this.parts.elements, ((part) => { _.each(this.parts.elements, (part => {
var partBox = part.container.getBBox(); var partBox = part.container.getBBox();
part.container.transform(Snap.matrix() part.container.transform(Snap.matrix()