Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use the BoundsInfo object when positioning the element to take advant…

…age of the cached x/y
  • Loading branch information...
commit 673c731a95c53ddc4e551ff9884828be50e23852 1 parent de0be44
Jason Johnston authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 sources/RootRenderer.js
View
12 sources/RootRenderer.js
@@ -25,7 +25,7 @@ PIE.RootRenderer = PIE.RendererBase.newRenderer( {
var el = this.targetElement,
par = el,
docEl,
- elRect, parRect,
+ elBounds, parRect,
s = this.getBox().style, cs,
x = 0, y = 0;
@@ -34,16 +34,16 @@ PIE.RootRenderer = PIE.RendererBase.newRenderer( {
do {
par = par.offsetParent;
} while( par && par.currentStyle.position === 'static' );
- elRect = el.getBoundingClientRect();
+ elBounds = this.boundsInfo.getBounds();
if( par ) {
parRect = par.getBoundingClientRect();
cs = par.currentStyle;
- x = elRect.left - parRect.left - ( parseFloat(cs.borderLeftWidth) || 0 );
- y = elRect.top - parRect.top - ( parseFloat(cs.borderTopWidth) || 0 );
+ x = elBounds.x - parRect.left - ( parseFloat(cs.borderLeftWidth) || 0 );
+ y = elBounds.y - parRect.top - ( parseFloat(cs.borderTopWidth) || 0 );
} else {
docEl = doc.documentElement;
- x = elRect.left + docEl.scrollLeft - docEl.clientLeft;
- y = elRect.top + docEl.scrollTop - docEl.clientTop;
+ x = elBounds.x + docEl.scrollLeft - docEl.clientLeft;
+ y = elBounds.y + docEl.scrollTop - docEl.clientTop;
}
s.left = x;
Please sign in to comment.
Something went wrong with that request. Please try again.