Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

… when positioning the main css3-container.
  • Loading branch information...
commit fa4929ee3b7040c6c8d7b78299cc4f5e211e66ac 1 parent 6341fd2
Jason Johnston authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 sources/RootRenderer.js
7 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;
Please sign in to comment.
Something went wrong with that request. Please try again.