[orx-fcurve] Add support for single constant values

This commit is contained in:
Edwin Jakobs
2024-04-25 10:17:06 +02:00
parent d765529f05
commit e707786c3d
3 changed files with 50 additions and 1 deletions

View File

@@ -477,6 +477,9 @@ private fun evaluateFCurveCommands(parts: List<String>): FCurve {
}
fun fcurve(d: String): FCurve {
val constantExpression = d.toDoubleOrNull()
if (constantExpression != null) {
return FCurve(listOf(Segment2D(Vector2(0.0, constantExpression), Vector2(0.0, constantExpression))))
}
return evaluateFCurveCommands(fCurveCommands(d))
}