Fixes for OPENRNDR 0.3.58 compatibility

This commit is contained in:
Edwin Jakobs
2021-05-15 10:05:19 +02:00
parent 552a0448d1
commit 6bbe93eda7
7 changed files with 54 additions and 54 deletions

View File

@@ -39,7 +39,7 @@ class IntervalNode<T>(val center: Double) {
fun <T : Any> buildIntervalTree(items: List<T>, intervalFunction: (T) -> Pair<Double, Double>): IntervalNode<T> {
val ranges = items.map { intervalFunction(it) }
val center = ranges.sumByDouble { (it.first + it.second) / 2.0 } / ranges.size
val center = ranges.sumOf { (it.first + it.second) / 2.0 } / ranges.size
val node = IntervalNode<T>(center)
val leftItems = mutableListOf<T>()
val rightItems = mutableListOf<T>()