Upgrade to Kotlin 1.4, Gradle 6.6
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user