Replace mod_() calls with mod()

This commit is contained in:
Edwin Jakobs
2023-04-29 13:51:06 +02:00
parent 175200abdb
commit ccd7a98b12
14 changed files with 17 additions and 17 deletions

View File

@@ -14,7 +14,7 @@ fun main() {
extend {
duotone.labInterpolation = seconds.mod_(2.0) < 1.0
duotone.labInterpolation = seconds.mod(2.0) < 1.0
duotone.apply(image, filteredImage)
drawer.image(filteredImage)

View File

@@ -18,7 +18,7 @@ fun main() {
lumaHalftone.phase0 = seconds*0.1
lumaHalftone.phase1 = -seconds*0.1
lumaHalftone.apply(image, filteredImage)
lumaHalftone.invert = seconds.mod_(2.0) < 1.0
lumaHalftone.invert = seconds.mod(2.0) < 1.0
drawer.image(filteredImage)
}
}

View File

@@ -45,7 +45,7 @@ fun main() = application {
fov = 40.0
}
extend {
sceneData.animations[0].applyToTargets(seconds.mod_(sceneData.animations[0].duration))
sceneData.animations[0].applyToTargets(seconds.mod(sceneData.animations[0].duration))
drawer.clear(ColorRGBa.PINK)
renderer.draw(drawer, scene)
}

View File

@@ -32,7 +32,7 @@ fun main() = application {
val cameras = scene.root.findContent { this as? PerspectiveCamera }
extend {
sceneData.animations[0].applyToTargets(seconds.mod_(sceneData.animations[0].duration))
sceneData.animations[0].applyToTargets(seconds.mod(sceneData.animations[0].duration))
drawer.view = cameras[0].content.viewMatrix
drawer.projection = cameras[0].content.projectionMatrix
drawer.clear(ColorRGBa.PINK)

View File

@@ -35,7 +35,7 @@ fun main() = application {
camera.setView(Vector3.ZERO, Spherical(30.50, 26.0, 5.6), 40.0)
}
extend {
sceneData.animations[0].applyToTargets(seconds.mod_(sceneData.animations[0].duration))
sceneData.animations[0].applyToTargets(seconds.mod(sceneData.animations[0].duration))
drawer.clear(ColorRGBa.PINK)
renderer.draw(drawer, scene)
}

View File

@@ -36,7 +36,7 @@ fun main() = application {
camera.setView(Vector3(-0.514, -0.936, -1.122), Spherical(454.346, 25.0, 8.444), 40.0)
}
extend {
sceneData.animations[0].applyToTargets(seconds.mod_(sceneData.animations[0].duration))
sceneData.animations[0].applyToTargets(seconds.mod(sceneData.animations[0].duration))
drawer.clear(ColorRGBa.PINK)
renderer.draw(drawer, scene)
}

View File

@@ -35,7 +35,7 @@ fun main() = application {
}
extend {
sceneData.animations[0].applyToTargets(seconds.mod_(sceneData.animations[0].duration))
sceneData.animations[0].applyToTargets(seconds.mod(sceneData.animations[0].duration))
drawer.clear(ColorRGBa.PINK)
renderer.draw(drawer, scene)
}

View File

@@ -37,7 +37,7 @@ fun main() = application {
}
extend {
sceneData.animations[2].applyToTargets(seconds.mod_(sceneData.animations[2].duration))
sceneData.animations[2].applyToTargets(seconds.mod(sceneData.animations[2].duration))
drawer.clear(ColorRGBa.PINK)
renderer.draw(drawer, scene)
}

View File

@@ -39,7 +39,7 @@ fun main() = application {
}
extend {
sceneData.animations[2].applyToTargets(seconds.mod_(sceneData.animations[2].duration))
sceneData.animations[2].applyToTargets(seconds.mod(sceneData.animations[2].duration))
drawer.clear(ColorRGBa.PINK)
renderer.draw(drawer, scene)
}

View File

@@ -136,9 +136,9 @@ class ControlManager : Extension {
target = if (target != null) {
if (KeyModifier.SHIFT in event.modifiers) {
focusableControls[(index - 1).mod_(focusableControls.size)]
focusableControls[(index - 1).mod(focusableControls.size)]
} else {
focusableControls[(index + 1).mod_(focusableControls.size)]
focusableControls[(index + 1).mod(focusableControls.size)]
}
} else {
lastTarget ?: focusableControls[0]

View File

@@ -267,7 +267,7 @@ fun ((Int, Double) -> Double).crossFade(
width: Double = 0.5
): (Int, Double) -> Double {
return { seed, t ->
val a = t.map(start, end, 0.0, 1.0).mod_(1.0)
val a = t.map(start, end, 0.0, 1.0).mod(1.0)
val f = (a / width).coerceAtMost(1.0)
val o = this(seed, a.map(0.0, 1.0, start, end)) * f
val s = this(seed, (a + 1.0).map(0.0, 1.0, start, end)) * (1.0 - f)
@@ -281,7 +281,7 @@ fun ((Int, Double, Double) -> Double).crossFade(
width: Double = 0.5
): (Int, Double, Double) -> Double {
return { seed, x, t ->
val a = t.map(start, end, 0.0, 1.0).mod_(1.0)
val a = t.map(start, end, 0.0, 1.0).mod(1.0)
val f = (a / width).coerceAtMost(1.0)
val o = this(seed, x, a.map(0.0, 1.0, start, end)) * f
val s = this(seed, x, (a + 1.0).map(0.0, 1.0, start, end)) * (1.0 - f)
@@ -295,7 +295,7 @@ fun ((Int, Double, Double, Double) -> Double).crossFade(
width: Double = 0.5
): (Int, Double, Double, Double) -> Double {
return { seed, x, y, t ->
val a = t.map(start, end, 0.0, 1.0).mod_(1.0)
val a = t.map(start, end, 0.0, 1.0).mod(1.0)
val f = (a / width).coerceAtMost(1.0)
val o = this(seed, x, y, a.map(0.0, 1.0, start, end)) * f
val s = this(seed, x, y, (a + 1.0).map(0.0, 1.0, start, end)) * (1.0 - f)

View File

@@ -19,7 +19,7 @@ fun main() {
drawer.fill = ColorRGBa.PINK
drawer.circles(points, 4.0)
if (seconds.mod_(2.0) < 1.0) {
if (seconds.mod(2.0) < 1.0) {
drawer.stroke = ColorRGBa.PINK
drawer.fill = null
drawer.shape(shape)

View File

@@ -38,4 +38,4 @@ fun ShapeContour.bulgeSegments(distortion: Double) =
bulgeSegments { _, _ -> distortion }
fun ShapeContour.bulgeSegments(distortion: List<Double>) =
bulgeSegments { index, _ -> distortion[index.mod_(distortion.size)] }
bulgeSegments { index, _ -> distortion[index.mod(distortion.size)] }

View File

@@ -163,7 +163,7 @@ fun ShapeContour.arcCorners(lengths: List<Double>,
private class Ring<T>(private val x: List<T>) : List<T> by x {
override operator fun get(index: Int): T {
return x[index.mod_(x.size)]
return x[index.mod(x.size)]
}
}