Skip to content
Browse files

Work around weird bug in IE7 (at least) where sometimes the box-shado…

…w would be rendered too tall, even though the dimensions and path were all set correctly. Moving the width/height setting to the end seems to work around it.
  • Loading branch information...
1 parent 968d61d commit 6e2d2a3c17ab6d7a306c0835f50308d0f14b7024 Jason Johnston committed Jul 27, 2010
Showing with 7 additions and 5 deletions.
  1. +7 −5 sources/BoxShadowOutsetRenderer.js
View
12 sources/BoxShadowOutsetRenderer.js
@@ -40,14 +40,12 @@ PIE.BoxShadowOutsetRenderer = PIE.RendererBase.newRenderer( {
function getShadowShape( index, corner, xOff, yOff, color, blur, path ) {
var shape = me.getShape( 'shadow' + index + corner, 'fill', box, len - index ),
- ss = shape.style;
+ ss = shape.style,
fill = shape.fill;
// Position and size
ss.left = xOff;
ss.top = yOff;
- ss.width = w;
- ss.height = h;
shape['coordsize'] = w * 2 + ',' + h * 2;
shape['coordorigin'] = '1,1';
@@ -64,6 +62,10 @@ PIE.BoxShadowOutsetRenderer = PIE.RendererBase.newRenderer( {
// Path
shape.path = path;
+ // This needs to go last for some reason, to prevent rendering at incorrect size
+ ss.width = w;
+ ss.height = h;
+
return shape;
}
@@ -114,13 +116,13 @@ PIE.BoxShadowOutsetRenderer = PIE.RendererBase.newRenderer( {
}
} else {
// TODO delete old quadrant shapes if resizing expands past the barrier
- shape = getShadowShape( i, null, xOff, yOff, color, blur, path );
+ shape = getShadowShape( i, '', xOff, yOff, color, blur, path );
fill = shape.fill;
fill['focusposition'] = focusX + ',' + focusY;
fill['focussize'] = ( 1 - focusX * 2 ) + ',' + ( 1 - focusY * 2 );
}
} else {
- shape = getShadowShape( i, null, xOff, yOff, color, blur, path );
+ shape = getShadowShape( i, '', xOff, yOff, color, blur, path );
alpha = color.alpha();
if( alpha < 1 ) {
// shape.style.filter = 'alpha(opacity=' + ( alpha * 100 ) + ')';

0 comments on commit 6e2d2a3

Please sign in to comment.
Something went wrong with that request. Please try again.