Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Prevent error in border image renderer when side slices get calculate…

…d to less than zero width or height
  • Loading branch information...
commit 8aa3f1b9eb73d2df13d409031a204115d431f3bb 1 parent 58d2df7
Jason Johnston authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 sources/BorderImageRenderer.js
10 sources/BorderImageRenderer.js
View
@@ -19,9 +19,10 @@ PIE.BorderImageRenderer = PIE.RendererBase.newRenderer( {
},
draw: function() {
+ this.getBox(); //make sure pieces are created
+
var props = this.styleInfos.borderImageInfo.getProps(),
bounds = this.boundsInfo.getBounds(),
- box = this.getBox(), //make sure pieces are created
el = this.targetElement,
pieces = this.pieces;
@@ -42,9 +43,10 @@ PIE.BorderImageRenderer = PIE.RendererBase.newRenderer( {
// Piece positions and sizes
function setSizeAndPos( piece, w, h, x, y ) {
- var s = pieces[piece].style;
- s.width = w;
- s.height = h;
+ var s = pieces[piece].style,
+ max = Math.max;
+ s.width = max(w, 0);
+ s.height = max(h, 0);
s.left = x;
s.top = y;
}
Please sign in to comment.
Something went wrong with that request. Please try again.