Skip to content

Commit

Permalink
Merge pull request Leaflet#1205 from mohlendo/master
Browse files Browse the repository at this point in the history
Fixes Issue 1204: Adds the border width to the viewport offset calculation
  • Loading branch information
mourner committed Dec 10, 2012
2 parents 96e4c80 + cf883a0 commit 236b8fb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/dom/DomUtil.js
Expand Up @@ -35,6 +35,11 @@ L.DomUtil = {
do {
top += el.offsetTop || 0;
left += el.offsetLeft || 0;

//add borders
top += parseInt(L.DomUtil.getStyle(el, "borderTopWidth"), 10) || 0;
left += parseInt(L.DomUtil.getStyle(el, "borderLeftWidth"), 10) || 0;

pos = L.DomUtil.getStyle(el, 'position');

if (el.offsetParent === docBody && pos === 'absolute') { break; }
Expand Down

0 comments on commit 236b8fb

Please sign in to comment.