File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
kool-core/src/commonMain/kotlin/de/fabmax/kool/scene Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ open class Node(name: String? = null) : BaseReleasable() {
2727 val tags = Tags ()
2828
2929 protected val mutChildren = mutableListOf<Node >()
30+ private val cachedChildren = mutableListOf<Node >()
3031 val children: List <Node > get() = mutChildren
3132
3233 /* *
@@ -143,8 +144,10 @@ open class Node(name: String? = null) : BaseReleasable() {
143144
144145 bounds.batchUpdate {
145146 clear()
146- for (i in mutChildren.lastIndex downTo 0 ) {
147- val child = mutChildren[i]
147+ cachedChildren.clear()
148+ cachedChildren.addAll(mutChildren)
149+ for (i in cachedChildren.indices) {
150+ val child = cachedChildren[i]
148151 child.update(updateEvent)
149152 child.addBoundsToParentBounds(bounds)
150153 }
You can’t perform that action at this time.
0 commit comments