tuned;
authorwenzelm
Sun, 04 Jan 2015 21:53:05 +0100
changeset 59264 fecf1d5a2454
parent 59263 03aedb32a763
child 59265 962ad3942ea7
tuned;
src/Tools/Graphview/layout.scala
--- a/src/Tools/Graphview/layout.scala	Sun Jan 04 21:29:52 2015 +0100
+++ b/src/Tools/Graphview/layout.scala	Sun Jan 04 21:53:05 2015 +0100
@@ -272,11 +272,11 @@
       math.abs(right(coords) - to.right(coords))
 
     def deflection(coords: Coordinates, top_down: Boolean): Double =
-      (for {
-        k <- nodes.iterator
-        x = coords(k).x
-        as = if (top_down) graph.imm_preds(k) else graph.imm_succs(k)
-      } yield as.iterator.map(coords(_).x - x).sum / (as.size max 1)).sum / nodes.length
+      (for (a <- nodes.iterator) yield {
+        val x = coords(a).x
+        val bs = if (top_down) graph.imm_preds(a) else graph.imm_succs(a)
+        bs.iterator.map(coords(_).x - x).sum / (bs.size max 1)
+      }).sum / nodes.length
 
     def move(coords: Coordinates, dx: Double): Coordinates =
       (coords /: nodes) {