X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=7874005e13da340544f0de8da8eccd6cc59d63b7;hb=806f92c1e4f78e75fae857ccfad3276fd5524ac6;hp=456a56c8f44e2c595e3ffaacb0937bba044ef8f7;hpb=fc1c2420cb32dd154c8d88e51780f8a3788a94fe;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index 456a56c..7874005 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1301,24 +1301,6 @@ Dygraph.prototype.createRollInterface_ = function() { }; /** - * @private - * Converts page the x-coordinate of the event to pixel x-coordinates on the - * canvas (i.e. DOM Coords). - */ -Dygraph.prototype.dragGetX_ = function(e, context) { - return Dygraph.pageX(e) - context.px; -}; - -/** - * @private - * Converts page the y-coordinate of the event to pixel y-coordinates on the - * canvas (i.e. DOM Coords). - */ -Dygraph.prototype.dragGetY_ = function(e, context) { - return Dygraph.pageY(e) - context.py; -}; - -/** * Set up all the mouse handlers needed to capture dragging behavior for zoom * events. * @private @@ -1378,8 +1360,8 @@ Dygraph.prototype.createDragInterface_ = function() { var canvasPos = Dygraph.findPos(g.canvas_); contextB.px = canvasPos.x; contextB.py = canvasPos.y; - contextB.dragStartX = g.dragGetX_(event, contextB); - contextB.dragStartY = g.dragGetY_(event, contextB); + contextB.dragStartX = Dygraph.dragGetX_(event, contextB); + contextB.dragStartY = Dygraph.dragGetY_(event, contextB); contextB.cancelNextDblclick = false; contextB.tarp.cover(); } @@ -1735,7 +1717,7 @@ Dygraph.prototype.eventToDomCoords = function(event) { if (event.offsetX && event.offsetY) { return [ event.offsetX, event.offsetY ]; } else { - var eventElementPos = Dygraph.findPos(this.mouseEventElement_) + var eventElementPos = Dygraph.findPos(this.mouseEventElement_); var canvasx = Dygraph.pageX(event) - eventElementPos.x; var canvasy = Dygraph.pageY(event) - eventElementPos.y; return [canvasx, canvasy];