[orx-easing] Add Serializable annotations
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
plugins {
|
||||
org.openrndr.extra.convention.`kotlin-multiplatform`
|
||||
// kotlinx-serialization ends up on the classpath through openrndr-math and Gradle doesn't know which
|
||||
// version was used. If openrndr were an included build, we probably wouldn't need to do this.
|
||||
// https://github.com/gradle/gradle/issues/20084
|
||||
id(libs.plugins.kotlin.serialization.get().pluginId)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
@@ -12,6 +16,7 @@ kotlin {
|
||||
implementation(libs.openrndr.draw)
|
||||
implementation(libs.openrndr.filter)
|
||||
implementation(libs.kotlin.reflect)
|
||||
implementation(libs.kotlin.serialization.core)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.openrndr.extra.easing
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlin.math.*
|
||||
|
||||
typealias EasingFunction = (Double, Double, Double, Double) -> Double
|
||||
@@ -297,6 +298,7 @@ fun easeSineInOut(t: Double, b: Double = 0.0, c: Double = 1.0, d: Double = 1.0):
|
||||
* Use the `Easing.values()` list to iterate over available functions,
|
||||
* query its `.size` property or get functions by index.
|
||||
*/
|
||||
@Serializable
|
||||
enum class Easing(val function: EasingFunction) {
|
||||
Linear(::easeLinear),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user