Make image preview scalable

This commit is contained in:
nea
2023-07-23 01:35:16 +02:00
parent cdf3938b77
commit 91febc31ad
9 changed files with 158 additions and 23 deletions

View File

@@ -0,0 +1,7 @@
package moe.nea.firmament.util
import kotlin.properties.ReadOnlyProperty
fun <T, V, M> ReadOnlyProperty<T, V>.map(mapper: (V) -> M): ReadOnlyProperty<T, M> {
return ReadOnlyProperty { thisRef, property -> mapper(this@map.getValue(thisRef, property)) }
}