fixes Issue 1204: border width is now added to viewpoint offset calculation

This commit is contained in:
Manuel Ohlendorf 2012-12-06 13:25:17 +01:00
parent 7e029d21cc
commit 94a8b19f11

View File

@ -35,6 +35,11 @@ L.DomUtil = {
do { do {
top += el.offsetTop || 0; top += el.offsetTop || 0;
left += el.offsetLeft || 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'); pos = L.DomUtil.getStyle(el, 'position');
if (el.offsetParent === docBody && pos === 'absolute') { break; } if (el.offsetParent === docBody && pos === 'absolute') { break; }