Only call custom tooltips when elements have changed. But be sure to call update internally any time that tooltips need to be redrawn.

This commit is contained in:
Tanner Linsley
2015-11-01 13:56:36 -07:00
parent cf587122da
commit f4a5a30451
3 changed files with 10 additions and 6 deletions

View File

@@ -459,6 +459,7 @@
// The usual updates
this.tooltip.initialize();
this.tooltip._active = this.tooltipActive;
this.tooltip.update();
}
// Hover animations
@@ -484,11 +485,12 @@
(this.lastTooltipActive.length !== this.tooltipActive.length) ||
changed) {
if (this.options.tooltips.enabled || this.options.tooltips.custom) {
this.tooltip.update();
}
this.stop();
if (this.options.tooltips.enabled || this.options.tooltips.custom) {
this.tooltip.update(true);
}
// We only need to render at this point. Updating will cause scales to be recomputed generating flicker & using more
// memory than necessary.
this.render(this.options.hover.animationDuration, true);