Skip to content

Commit

Permalink
Reduce file size
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jun 24, 2019
1 parent 450d24e commit 01b9853
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/core/core.scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,14 +613,13 @@ var Scale = Element.extend({
*/
_getLabelSizes: function() {
var me = this;
var labelSizes;
var labelSizes = me._labelSizes;

if (me._labelSizes) {
return me._labelSizes;
if (!labelSizes) {
me._labelSizes = labelSizes = computeLabelSizes(me.ctx, parseTickFontOptions(me.options.ticks), me.getTicks(), me.longestTextCache);
me.longestLabelWidth = labelSizes.widest.width;
}

me._labelSizes = labelSizes = computeLabelSizes(me.ctx, parseTickFontOptions(me.options.ticks), me.getTicks(), me.longestTextCache);
me.longestLabelWidth = labelSizes.widest.width;
return labelSizes;
},

Expand Down

0 comments on commit 01b9853

Please sign in to comment.