diff --git a/lib/features/zoomscroll/ZoomScroll.js b/lib/features/zoomscroll/ZoomScroll.js index 78294f78..a4e0cdaa 100644 --- a/lib/features/zoomscroll/ZoomScroll.js +++ b/lib/features/zoomscroll/ZoomScroll.js @@ -56,8 +56,8 @@ function ZoomScroll(events, canvas) { // Gecko Browser should use _offsetX if(!event.originalEvent.offsetX) { offset = { - x: event.originalEvent._offsetX, - y: event.originalEvent._offsetY + x: event.originalEvent.layerX, + y: event.originalEvent.layerY }; } else { offset = { @@ -88,30 +88,3 @@ ZoomScroll.$inject = [ 'eventBus', 'canvas' ]; module.exports = ZoomScroll; -// Thx to https://bugzilla.mozilla.org/show_bug.cgi?id=69787#c37 -// for providing a work around for missing offsetX in Gecko -Object.defineProperties(MouseEvent.prototype, { - _offsetRelativeElement: { - get: function() { - var element = this.target; - while (['block', 'inline-block', 'list-item', 'table', 'inline-table', 'table-caption', - 'table-column', 'table-colgroup', 'table-header-group', 'table-row-group', 'table-footer-group', - 'table-row', 'table-cell'].indexOf(window.getComputedStyle(element).display) === -1) { - - element = element.parentNode; - } - - return element; - } - }, - _offsetX: { - get: function() { - return this.clientX - this._offsetRelativeElement.getBoundingClientRect().left; - } - }, - _offsetY: { - get: function() { - return this.clientY - this._offsetRelativeElement.getBoundingClientRect().top; - } - } -}); \ No newline at end of file