add z-index parameter to cursors, and refactor code to use them

This commit is contained in:
2025-09-11 01:53:13 +01:00
parent 2e0f749229
commit 0f78a25382
4 changed files with 27 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ struct
fun yToNdc (yOffset, ypos, scale, halfHeight) =
~(((ypos * scale + yOffset) - halfHeight) / halfHeight)
fun lerp (xOffset: Real32.real, yOffset, scale, windowWidth, windowHeight, r, g, b) =
fun lerp (xOffset: Real32.real, yOffset, z, scale, windowWidth, windowHeight, r, g, b) =
let
val halfWidth = windowWidth / 2.0
val halfHeight = windowHeight / 2.0
@@ -14,21 +14,27 @@ struct
#[
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
yToNdc (yOffset, 13.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 6.000000000000000, scale, halfWidth),
yToNdc (yOffset, 13.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 6.000000000000000, scale, halfWidth),
yToNdc (yOffset, 13.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 6.000000000000000, scale, halfWidth),
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
z,
r, g, b
]
end