Skip to content

Commit

Permalink
Fix divide-by-zero error when the total width or height of the box-sh…
Browse files Browse the repository at this point in the history
…adow shape is zero.
  • Loading branch information
Jason Johnston committed Nov 20, 2011
1 parent d9df42d commit 28d18b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sources/BoxShadowOutsetRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 28d18b5

Please sign in to comment.