Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

IE7 zoom: use offsetWidth/Height directly in boundsInfo width/height …

…instead of multiplying so they are always rounded, as VML doesn't like fractional values.
  • Loading branch information...
commit 32733961d018fb2b404f0087923dd709db31aac2 1 parent 8026857
@lojjic authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 sources/BoundsInfo.js
View
16 sources/BoundsInfo.js
@@ -26,18 +26,18 @@ PIE.BoundsInfo.prototype = {
var el = this.targetElement,
rect = el.getBoundingClientRect(),
isIE9 = PIE.ieDocMode === 9,
- width = rect.right - rect.left,
- // IE7 is inconsistent in using logical vs. device pixels in measurements so we must
- // calculate the ratio and use it in certain places as a position adjustment
- logicalZoomRatio = ( PIE.ieVersion === 7 && width ) ? el.offsetWidth / width : 1;
+ isIE7 = PIE.ieVersion === 7,
+ width = rect.right - rect.left;
return {
x: rect.left,
y: rect.top,
// In some cases scrolling the page will cause IE9 to report incorrect dimensions
- // in the rect returned by getBoundingClientRect, so we must query offsetWidth/Height instead
- w: isIE9 ? el.offsetWidth : width * logicalZoomRatio,
- h: isIE9 ? el.offsetHeight : ( rect.bottom - rect.top ) * logicalZoomRatio,
- logicalZoomRatio: logicalZoomRatio
+ // in the rect returned by getBoundingClientRect, so we must query offsetWidth/Height
+ // instead. Also IE7 is inconsistent in using logical vs. device pixels in measurements
+ // so we must calculate the ratio and use it in certain places as a position adjustment.
+ w: isIE9 || isIE7 ? el.offsetWidth : width,
+ h: isIE9 || isIE7 ? el.offsetHeight : rect.bottom - rect.top,
+ logicalZoomRatio: ( isIE7 && width ) ? el.offsetWidth / width : 1
};
},
Please sign in to comment.
Something went wrong with that request. Please try again.