[orx-fcurve] Fix bug in Segment2D.tForX

This commit is contained in:
Edwin Jakobs
2024-04-21 09:37:35 +02:00
parent 8eccde914b
commit dda653b2cf
2 changed files with 12 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import org.openrndr.extra.fcurve.efcurve
import org.openrndr.extra.fcurve.fcurve
import kotlin.test.Test
import kotlin.test.assertEquals
@@ -30,4 +31,11 @@ class TestEFCurve {
assertEquals("M0 L1.0, ${0.0} L1.0, ${1.0}", efcurve("M0 (L1.0, {it})[2]"))
assertEquals("M0 L1.0, ${0.0} L1.0, ${1.0} L1.0, ${0.0} L1.0, ${1.0} L1.0, ${0.0} L1.0, ${1.0}", efcurve("M0 ((L1.0, {it})[2])[3]"))
}
@Test
fun testContinuity() {
val fc = fcurve("Q1 25% 3 100 Q1 25% 3 0 Q1 25% 3 100 Q1 25% 3 0")
val s = fc.sampler()
assertEquals(0.0, s(6.0))
}
}