Skip to content
Snippets Groups Projects
Commit ec75d98f authored by Will Billingsley's avatar Will Billingsley
Browse files

Update updateChildren for newer version

parent acafa9e2
No related branches found
No related tags found
No related merge requests found
...@@ -216,14 +216,18 @@ trait DiffNode extends DNode with MakeItSo { ...@@ -216,14 +216,18 @@ trait DiffNode extends DNode with MakeItSo {
def updateChildren(to:Seq[VNode]):Unit = { def updateChildren(to:Seq[VNode]):Unit = {
// Use a diff algorithm to work out changes to make to children // Use a diff algorithm to work out changes to make to children
val diffOps = Differ.seqDiff(children, to) val diffReport = Differ.diffs(children, to)
// implement changes // implement changes
Differ.processDiffs(this, diffReport.ops)
children = diffReport.update
// Recurse down the DiffNode's (new) children, getting them to "make it so" // Recurse down the DiffNode's (new) children, getting them to "make it so"
updating.zip(to).collect({ case (x:MakeItSo, y:MakeItSo) => children.iterator.zip(to.iterator) foreach {
x.makeItSo(y) case (uu:MakeItSo, tt:MakeItSo) => uu.makeItSo(tt)
}) case (u:Update, _) => u.update()
case _ => // nothing to do
}
} }
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment