clipping rectangles for interaction layer two_axes
authorDan Vanderkam <danvdk@gmail.com>
Fri, 22 Oct 2010 03:25:27 +0000 (23:25 -0400)
committerDan Vanderkam <danvdk@gmail.com>
Fri, 22 Oct 2010 03:25:27 +0000 (23:25 -0400)
dygraph-canvas.js
dygraph.js

index c5c0ee0..0aa7ca1 100644 (file)
@@ -309,12 +309,12 @@ DygraphCanvasRenderer = function(dygraph, element, layout, options) {
 
   // Set up a clipping area for the canvas (and the interaction canvas).
   // This ensures that we don't overdraw.
-  var ctx = this.element.getContext("2d");
+  var ctx = this.dygraph_.canvas_.getContext("2d");
   ctx.beginPath();
   ctx.rect(this.area.x, this.area.y, this.area.w, this.area.h);
   ctx.clip();
 
-  var ctx = this.dygraph_.hidden_.getContext("2d");
+  ctx = this.dygraph_.hidden_.getContext("2d");
   ctx.beginPath();
   ctx.rect(this.area.x, this.area.y, this.area.w, this.area.h);
   ctx.clip();
index 8fbe9fa..6e9aac7 100644 (file)
@@ -691,7 +691,7 @@ Dygraph.prototype.positionLabelsDiv_ = function() {
 
   var area = this.plotter_.area;
   var div = this.attr_("labelsDiv");
-  div.style.left = area.x + area.w - this.attr_("labelsDivWidth") + "px";
+  div.style.left = area.x + area.w - this.attr_("labelsDivWidth") - 1 + "px";
 };
 
 /**