this.element = element;
this.elementContext = elementContext;
- this.height = this.element.height;
- this.width = this.element.width;
+ this.height = dygraph.height_;
+ this.width = dygraph.width_;
// --- check whether everything is ok before we return
// NOTE(konigsberg): isIE is never defined in this object. Bug of some sort.
// Right side
createClipDiv({
x: plotArea.x + plotArea.w, y: 0,
- w: this.width-plotArea.x - plotArea.w,
+ w: this.width - plotArea.x - plotArea.w,
h: this.height
});
* context.
*/
Dygraph.Interaction.endZoom = function(event, g, context) {
+ g.clearZoomRect_();
context.isZooming = false;
Dygraph.Interaction.maybeTreatMouseOpAsClick(event, g, context);
g.doZoomY_(top, bottom);
}
context.cancelNextDblclick = true;
- } else {
- if (context.zoomMoved) g.clearZoomRect_();
}
context.dragStartX = null;
context.dragStartY = null;
*/
Dygraph.prototype.clearZoomRect_ = function() {
this.currentZoomRectArgs_ = null;
- this.canvas_ctx_.clearRect(0, 0, this.canvas_.width, this.canvas_.height);
+ this.canvas_ctx_.clearRect(0, 0, this.width_, this.height_);
};
/**
// TODO(danvk): is this a performance bottleneck when panning?
// The interaction canvas should already be empty in that situation.
- this.canvas_.getContext('2d').clearRect(0, 0, this.canvas_.width,
- this.canvas_.height);
+ this.canvas_.getContext('2d').clearRect(0, 0, this.width_, this.height_);
if (this.getFunctionOption("drawCallback") !== null) {
this.getFunctionOption("drawCallback")(this, is_initial_draw);
var context = e.drawingContext;
var containerDiv = e.canvas.parentNode;
- var canvasWidth = e.canvas.width;
- var canvasHeight = e.canvas.height;
+ var canvasWidth = g.width_; // e.canvas.width is affected by pixel ratio.
+ var canvasHeight = g.height_;
var label, x, y, tick, i;