Permalink
Browse files

Make the lock/unlock methods of BoundsInfo able to be called more tha…

…n once in nested logic
  • Loading branch information...
1 parent 2bc0efe commit 39fcb88c650d5acaa6d1c799666aa3a40ce5de63 Jason Johnston committed Sep 6, 2010
Showing with 5 additions and 4 deletions.
  1. +5 −4 sources/BoundsInfo.js
View
@@ -39,13 +39,14 @@ PIE.BoundsInfo.prototype = {
},
lock: function() {
- this._locked++;
+ ++this._locked;
},
unlock: function() {
- this._lastBounds = this._lockedBounds;
- this._lockedBounds = null;
- this._locked--;
+ if( !--this._locked ) {
+ this._lastBounds = this._lockedBounds;
+ this._lockedBounds = null;
+ }
}
};

0 comments on commit 39fcb88

Please sign in to comment.