Add comment to resize test case as a follow on to pull request 260.
[dygraphs.git] / dygraph.js
index 442c00c..db9a8bf 100644 (file)
@@ -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_();
   }