Merge pull request #217 from paulfelix/master
authorDan Vanderkam <danvdk@gmail.com>
Sat, 16 Feb 2013 16:32:29 +0000 (08:32 -0800)
committerDan Vanderkam <danvdk@gmail.com>
Sat, 16 Feb 2013 16:32:29 +0000 (08:32 -0800)
Fix for Issue 378: Mouse gradually drifts off of range selection handle

dygraph-canvas.js
dygraph-tickers.js
dygraph.js

index bf1d88d..0e1bc75 100644 (file)
@@ -57,8 +57,6 @@ var DygraphCanvasRenderer = function(dygraph, element, elementContext, layout) {
   this.height = this.element.height;
   this.width = this.element.width;
 
-  this.elementContext.save();
-
   // --- check whether everything is ok before we return
   if (!this.isIE && !(DygraphCanvasRenderer.isSupported(this.element)))
       throw "Canvas is not supported.";
@@ -127,11 +125,6 @@ DygraphCanvasRenderer.prototype.clear = function() {
   context.clearRect(0, 0, this.width, this.height);
 };
 
-DygraphCanvasRenderer.prototype.onDoneDrawing = function() {
-  // balances the save called in the constructor.
-  this.elementContext.restore();
-};
-
 /**
  * Checks whether the browser supports the &lt;canvas&gt; tag.
  * @private
index 6ad3102..77f2f62 100644 (file)
@@ -479,7 +479,13 @@ Dygraph.getDateAxis = function(start_time, end_time, granularity, opts, dg) {
   return ticks;
 };
 
-// These are set here so that this file can be included after dygraph.js.
+// These are set here so that this file can be included after dygraph.js
+// or independently.
+Dygraph.DEFAULT_ATTRS = Dygraph.DEFAULT_ATTRS || {};
+Dygraph.DEFAULT_ATTRS['axes'] = Dygraph.DEFAULT_ATTRS['axes'] || {};
+Dygraph.DEFAULT_ATTRS['axes']['x'] = Dygraph.DEFAULT_ATTRS['axes']['x'] || {};
+Dygraph.DEFAULT_ATTRS['axes']['y'] = Dygraph.DEFAULT_ATTRS['axes']['y'] || {};
+Dygraph.DEFAULT_ATTRS['axes']['y2'] = Dygraph.DEFAULT_ATTRS['axes']['y2'] || {};
 Dygraph.DEFAULT_ATTRS['axes']['x']['ticker'] = Dygraph.dateTicker;
 Dygraph.DEFAULT_ATTRS['axes']['y']['ticker'] = Dygraph.numericTicks;
 Dygraph.DEFAULT_ATTRS['axes']['y2']['ticker'] = Dygraph.numericTicks;
index f198cff..a02d919 100644 (file)
@@ -2200,8 +2200,6 @@ Dygraph.prototype.predraw_ = function() {
   // If the data or options have changed, then we'd better redraw.
   this.drawGraph_();
 
-  this.plotter_.onDoneDrawing();
-
   // This is used to determine whether to do various animations.
   var end = new Date();
   this.drawingTimeMs_ = (end - start);