Updating to automatically size labels when positioning

This commit is contained in:
Jeff Avallone 2014-12-10 19:16:21 -05:00
parent d953dcaab4
commit 15655900f1
2 changed files with 4 additions and 9 deletions

View File

@ -20,6 +20,8 @@ export default {
text: text text: text
}); });
this._labelGroups.push(group);
return group; return group;
}, },
@ -39,6 +41,7 @@ export default {
}, },
render() { render() {
this._labelGroups = [];
this._render(); this._render();
}, },
@ -46,6 +49,7 @@ export default {
if (this._proxy) { if (this._proxy) {
this._proxy.position(); this._proxy.position();
} else { } else {
_.each(this._labelGroups, this.positionLabel.bind(this));
this._position(); this._position();
} }
}, },
@ -70,7 +74,6 @@ export default {
}, },
_position() { _position() {
this.positionLabel(this.label);
}, },
spaceHorizontally(items, options) { spaceHorizontally(items, options) {

View File

@ -33,14 +33,6 @@ export default _.extend({}, Base, {
_position() { _position() {
var items; var items;
if (this.contents.anchor_start) {
this.positionLabel(this.contents.anchor_start);
}
if (this.contents.anchor_end) {
this.positionLabel(this.contents.anchor_end);
}
_.invoke(this.contents.parts, 'position'); _.invoke(this.contents.parts, 'position');
items = _(this.contents).values().flatten().value(); items = _(this.contents).values().flatten().value();