Upgrade to Kotlin 1.4, Gradle 6.6

This commit is contained in:
Edwin Jakobs
2020-08-18 08:30:18 +02:00
parent d7b17d6910
commit 5235d8ce19
22 changed files with 205 additions and 62 deletions

View File

@@ -37,7 +37,7 @@ class Envelope(constant:Double = 0.5) {
events.envelopeChanged.trigger(EnvelopeChangedEvent(this))
}
fun findNearestPoint(v: Vector2) = points.minBy { (it - v).length }
fun findNearestPoint(v: Vector2) = points.minByOrNull { (it - v).length }
fun removePoint(v: Vector2) {
points.remove(v)

View File

@@ -1,12 +1,13 @@
package org.openrndr.panel.hash
import kotlin.reflect.KProperty0
import kotlin.reflect.KProperty1
import kotlin.reflect.full.declaredMemberProperties
fun watchHash(toHash: Any): Int {
var hash = 0
for (property in toHash::class.declaredMemberProperties) {
val v = (property.getter)(toHash)
val v = ((property.getter) as KProperty1<Any, Any>).invoke(toHash)
if (v is KProperty0<*>) {
val pv = v.get()
hash = 31 * hash + (pv?.hashCode() ?: 0)