From 94a8b19f11cf64b6b4e8f9a2b1d56eea591e0f4c Mon Sep 17 00:00:00 2001 From: Manuel Ohlendorf Date: Thu, 6 Dec 2012 13:25:17 +0100 Subject: [PATCH] fixes Issue 1204: border width is now added to viewpoint offset calculation --- src/dom/DomUtil.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dom/DomUtil.js b/src/dom/DomUtil.js index 0a7fff65..0d35a3a7 100644 --- a/src/dom/DomUtil.js +++ b/src/dom/DomUtil.js @@ -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; }