Upgrade to Gradle 8.10, Kotlin 2.0.20, reduce warnings

This commit is contained in:
Edwin Jakobs
2024-08-25 09:39:18 +02:00
parent 5b6f2ec1ff
commit 8a4a85d333
37 changed files with 133 additions and 81 deletions

View File

@@ -5,6 +5,9 @@ import org.openrndr.draw.Drawer
import org.openrndr.draw.FontImageMap
import org.openrndr.math.Vector2
import org.openrndr.shape.Rectangle
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
class Cursor(var x: Double = 0.0, var y: Double = 0.0) {
constructor(cursor: Cursor) : this(cursor.x, cursor.y)
@@ -205,7 +208,11 @@ class TextWriter(val drawerRef: Drawer?) {
}
}
@OptIn(ExperimentalContracts::class)
fun <T> writer(drawer: Drawer, f: TextWriter.() -> T): T {
contract {
callsInPlace(f, InvocationKind.EXACTLY_ONCE)
}
val textWriter = TextWriter(drawer)
return textWriter.f()
}