Merge pull request #1205 from mohlendo/master

Fixes Issue 1204: Adds the border width to the viewport offset calculation
This commit is contained in:
Vladimir Agafonkin 2012-12-10 08:06:24 -08:00
commit 236b8fbbf0

View File

@ -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; }