mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 06:00:56 -05:00
Fix Item._clearBoundsCache() recursion, correctly this time.
This commit is contained in:
parent
a1c1fc8ed8
commit
a7f57315a6
1 changed files with 2 additions and 2 deletions
|
@ -1012,6 +1012,8 @@ var Item = Base.extend(Callback, /** @lends Item# */{
|
|||
for (var i = 0, list = item._boundsCache.list, l = list.length;
|
||||
i < l; i++) {
|
||||
var other = list[i];
|
||||
// Erase entry now, to prevent circular recursion.
|
||||
list[i] = null;
|
||||
if (other && other !== item) {
|
||||
other._bounds = other._position = undefined;
|
||||
// We need to recursively call _clearBoundsCache, as
|
||||
|
@ -1020,8 +1022,6 @@ var Item = Base.extend(Callback, /** @lends Item# */{
|
|||
if (other._boundsCache)
|
||||
Item._clearBoundsCache(other);
|
||||
}
|
||||
// Erase entry now, to prevent circular recursion.
|
||||
list[i] = null;
|
||||
}
|
||||
// Clear the item itself, as well as its bounds cache.
|
||||
item._bounds = item._position = item._boundsCache = undefined;
|
||||
|
|
Loading…
Reference in a new issue