progress fixing bugs in generated export string

This commit is contained in:
2025-07-13 01:40:57 +01:00
parent 31bc8485f3
commit 0e141174b2
5 changed files with 133 additions and 58 deletions

View File

@@ -25,16 +25,14 @@ struct
fun fromPixelX (xpos, windowWidth, windowHeight) =
let
val halfWidth = Real32.fromInt windowWidth / 2.0
val xpos = xpos - halfWidth
in
xpos / halfWidth
(xpos - halfWidth) / halfWidth
end
fun fromPixelY (ypos, windowWidth, windowHeight) =
let
val halfHeight = Real32.fromInt windowHeight / 2.0
val ypos = ~(ypos - halfHeight)
in
ypos / halfHeight
~((ypos - halfHeight) / halfHeight)
end
end