Permalink
Browse files

Take the top/left border width of the positioning parent into account…

… when positioning the main css3-container.
  • Loading branch information...
1 parent 6341fd2 commit fa4929ee3b7040c6c8d7b78299cc4f5e211e66ac Jason Johnston committed May 29, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 sources/RootRenderer.js
View
@@ -29,7 +29,7 @@ PIE.RootRenderer = PIE.RendererBase.newRenderer( {
par = el,
docEl,
elRect, parRect,
- s = this.getBox().style,
+ s = this.getBox().style, cs,
x = 0, y = 0;
// Get the element's offsets from its nearest positioned ancestor. Uses
@@ -40,8 +40,9 @@ PIE.RootRenderer = PIE.RendererBase.newRenderer( {
elRect = el.getBoundingClientRect();
if( par ) {
parRect = par.getBoundingClientRect();
- x = elRect.left - parRect.left;
- y = elRect.top - parRect.top;
+ cs = par.currentStyle;
+ x = elRect.left - parRect.left - ( parseFloat(cs.borderLeftWidth) || 0 );
+ y = elRect.top - parRect.top - ( parseFloat(cs.borderTopWidth) || 0 );
} else {
docEl = el.document.documentElement;
x = elRect.left + docEl.scrollLeft - docEl.clientLeft;

0 comments on commit fa4929e

Please sign in to comment.