X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=db9a8bfa7c79e9b2d5e17f1b24f20dce80f08b2a;hb=c1c42651dd140ecb0460cfcff736aceb117f9cc6;hp=442c00ce09359c28f7ba46efbbea2b8094517355;hpb=b5157325c87df7eb1d210e27e98fe45362f0c693;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index 442c00c..db9a8bf 100644 --- a/dygraph.js +++ b/dygraph.js @@ -3707,9 +3707,10 @@ Dygraph.prototype.resize = function(width, height) { this.height_ = this.maindiv_.clientHeight; } - this.resizeElements_(); - if (old_width != this.width_ || old_height != this.height_) { + // Resizing a canvas erases it, even when the size doesn't change, so + // any resize needs to be followed by a redraw. + this.resizeElements_(); this.predraw_(); }