src/Tools/Graphview/layout.scala
changeset 73591 2dd1fd9112d9
parent 73587 0af9e7e4476f
child 73606 d8a0e996614b
equal deleted inserted replaced
73590:0ffcad1f6130 73591:2dd1fd9112d9
   292       ((graph, false) /: level.indices) {
   292       ((graph, false) /: level.indices) {
   293         case ((graph, moved), i) =>
   293         case ((graph, moved), i) =>
   294           val r = level(i)
   294           val r = level(i)
   295           val d = r.deflection(graph, top_down)
   295           val d = r.deflection(graph, top_down)
   296           val dx =
   296           val dx =
   297             if (d < 0.0 && i > 0)
   297             if (d < 0.0 && i > 0) {
   298               - (level(i - 1).distance(metrics, graph, r) min (- d))
   298               - (level(i - 1).distance(metrics, graph, r) min (- d))
   299             else if (d >= 0.0 && i < level.length - 1)
   299             }
       
   300             else if (d >= 0.0 && i < level.length - 1) {
   300               r.distance(metrics, graph, level(i + 1)) min d
   301               r.distance(metrics, graph, level(i + 1)) min d
       
   302             }
   301             else d
   303             else d
   302           (r.move(graph, dx), moved || d != 0.0)
   304           (r.move(graph, dx), moved || d != 0.0)
   303       }
   305       }
   304     }
   306     }
   305 
   307