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 401e817 commit 3be66f60f65818bffb43b1a1c1e6dc5e18a39aed @lojjic committed Nov 20, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 sources/BoxShadowOutsetRenderer.js
@@ -89,8 +89,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( blur - spread > w / 2 || blur - spread > h / 2 ) {
// If the blur is larger than half the element's narrowest dimension, we cannot do
// this with a single shape gradient, because its focussize would have to be less than

0 comments on commit 3be66f6

Please sign in to comment.