From 94a8b19f11cf64b6b4e8f9a2b1d56eea591e0f4c Mon Sep 17 00:00:00 2001 From: Manuel Ohlendorf Date: Thu, 6 Dec 2012 13:25:17 +0100 Subject: [PATCH 1/2] 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; } From cf883a036d9b45d3874d361f7a1fb9ddf4ba46c7 Mon Sep 17 00:00:00 2001 From: Manuel Ohlendorf Date: Fri, 7 Dec 2012 11:05:38 +0100 Subject: [PATCH 2/2] fix indentation: use tabs instead of spaces --- src/dom/DomUtil.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dom/DomUtil.js b/src/dom/DomUtil.js index 0d35a3a7..d7470180 100644 --- a/src/dom/DomUtil.js +++ b/src/dom/DomUtil.js @@ -38,7 +38,7 @@ L.DomUtil = { //add borders top += parseInt(L.DomUtil.getStyle(el, "borderTopWidth"), 10) || 0; - left += parseInt(L.DomUtil.getStyle(el, "borderLeftWidth"), 10) || 0; + left += parseInt(L.DomUtil.getStyle(el, "borderLeftWidth"), 10) || 0; pos = L.DomUtil.getStyle(el, 'position');