Permalink
Browse files

Fix divide-by-zero error when the total width or height of the box-sh…

…adow shape is zero.
  • Loading branch information...
1 parent d9df42d commit 28d18b5fe508999e931c2600b45aa54b6eaccf6d Jason Johnston committed Nov 20, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 sources/BoxShadowOutsetRenderer.js
@@ -58,8 +58,8 @@ PIE.BoxShadowOutsetRenderer = PIE.RendererBase.newRenderer( {
if( blur ) {
totalW = ( spread + blur ) * 2 + w;
totalH = ( spread + blur ) * 2 + h;
- focusX = blur * 2 / totalW;
- focusY = blur * 2 / totalH;
+ focusX = totalW ? blur * 2 / totalW : 0;
+ focusY = totalH ? blur * 2 / totalH : 0;
// If the blur is larger than half the element's narrowest dimension, then its focussize
// will to be less than zero which results in ugly artifacts. To get around this, we adjust

0 comments on commit 28d18b5

Please sign in to comment.