Skip to content

Commit b869618

Browse files
committed
UpdateList returns the child added and checks before insertion
1 parent d43eb0d commit b869618

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

v3/src/scene/plugins/UpdateList.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var Class = require('../../utils/Class');
22

3+
// TODO - Extend from ProcessQueue
34
var UpdateList = new Class({
45

56
initialize:
@@ -15,7 +16,14 @@ var UpdateList = new Class({
1516

1617
add: function (child)
1718
{
18-
this._pendingInsertion.push(child);
19+
// Is child already in this list?
20+
21+
if (this._list.indexOf(child) === -1 && this._pendingInsertion.indexOf(child) === -1)
22+
{
23+
this._pendingInsertion.push(child);
24+
}
25+
26+
return child;
1927
},
2028

2129
begin: function ()

0 commit comments

Comments
 (0)