From: Dan Vanderkam Date: Fri, 22 Oct 2010 03:25:27 +0000 (-0400) Subject: clipping rectangles for interaction layer X-Git-Tag: v1.0.0~622^2 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=8c21adcf08251b522efcc6f4a8302aab455db186;p=dygraphs.git clipping rectangles for interaction layer --- diff --git a/dygraph-canvas.js b/dygraph-canvas.js index c5c0ee0..0aa7ca1 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -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(); diff --git a/dygraph.js b/dygraph.js index 8fbe9fa..6e9aac7 100644 --- a/dygraph.js +++ b/dygraph.js @@ -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"; }; /**