Skip to content

Commit

Permalink
Merge pull request #1 from jec006/fix_mouse_position_relative
Browse files Browse the repository at this point in the history
Fix issue with mouse position when page is scrolled
  • Loading branch information
geographist committed Jul 5, 2013
2 parents 914807c + 0c38132 commit 4e2a7f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dom/DomEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ L.DomEvent = {
var ie7 = L.Browser.ie7,
body = document.body,
docEl = document.documentElement,
x = e.pageX ? e.pageX : e.clientX + body.scrollLeft + docEl.scrollLeft,
y = e.pageY ? e.pageY : e.clientY + body.scrollTop + docEl.scrollTop,
x = e.pageX ? e.pageX - body.scrollLeft - docEl.scrollLeft: e.clientX,
y = e.pageY ? e.pageY - body.scrollTop - docEl.scrollTop: e.clientY,
pos = new L.Point(x, y),
rect = container.getBoundingClientRect(),
left = rect.left - container.clientLeft,
Expand Down

0 comments on commit 4e2a7f2

Please sign in to comment.