fix bug im output of export string: previously had 'endXToNdc' and 'endYToNdc' functions (which sometimes produced incorrect/pixelated output), but it turns out that I was meant to use only 'xToNdc' and 'yToNdc' for correct output.
This commit is contained in:
@@ -519,21 +519,11 @@ struct
|
|||||||
in "xToNdc (xOffset, " ^ x ^ ", scale, halfWidth)"
|
in "xToNdc (xOffset, " ^ x ^ ", scale, halfWidth)"
|
||||||
end
|
end
|
||||||
|
|
||||||
fun makeEndXString (startX, endX) =
|
|
||||||
let val endX = intToRealString endX
|
|
||||||
in "endXToNdc (xOffset, " ^ startX ^ ", " ^ endX ^ ", scale, halfWidth)"
|
|
||||||
end
|
|
||||||
|
|
||||||
fun makeYString y =
|
fun makeYString y =
|
||||||
let val y = intToRealString y
|
let val y = intToRealString y
|
||||||
in "yToNdc (yOffset, " ^ y ^ ", scale, halfHeight)"
|
in "yToNdc (yOffset, " ^ y ^ ", scale, halfHeight)"
|
||||||
end
|
end
|
||||||
|
|
||||||
fun makeEndYString (startY, endY) =
|
|
||||||
let val endY = intToRealString endY
|
|
||||||
in "endYToNdc (yOffset, " ^ startY ^ ", " ^ endY ^ ", scale, halfHeight)"
|
|
||||||
end
|
|
||||||
|
|
||||||
fun toExportStringFolder (maxWidth, maxHeight)
|
fun toExportStringFolder (maxWidth, maxHeight)
|
||||||
({x, ex, y, ey, data = {r, g, b, a}}, acc) =
|
({x, ex, y, ey, data = {r, g, b, a}}, acc) =
|
||||||
let
|
let
|
||||||
@@ -542,8 +532,8 @@ struct
|
|||||||
|
|
||||||
val x = makeXString x
|
val x = makeXString x
|
||||||
val y = makeYString y
|
val y = makeYString y
|
||||||
val ex = makeEndXString (x, ex)
|
val ex = makeXString ex
|
||||||
val ey = makeEndYString (y, ey)
|
val ey = makeYString ey
|
||||||
val r = colToRealString r
|
val r = colToRealString r
|
||||||
val g = colToRealString g
|
val g = colToRealString g
|
||||||
val b = colToRealString b
|
val b = colToRealString b
|
||||||
@@ -601,15 +591,9 @@ struct
|
|||||||
, " fun xToNdc (xOffset, xpos, scale, halfWidth) =\n"
|
, " fun xToNdc (xOffset, xpos, scale, halfWidth) =\n"
|
||||||
, " ((xpos * scale + xOffset) - halfWidth) / halfWidth\n\n"
|
, " ((xpos * scale + xOffset) - halfWidth) / halfWidth\n\n"
|
||||||
|
|
||||||
, " fun endXToNdc (xOffset, startX, endX, scale, halfWidth) =\n"
|
|
||||||
, " (((endX - startX) * scale + xOffset) - halfWidth) / halfWidth\n\n"
|
|
||||||
|
|
||||||
, " fun yToNdc (yOffset, ypos, scale, halfHeight) =\n"
|
, " fun yToNdc (yOffset, ypos, scale, halfHeight) =\n"
|
||||||
, " ~(((ypos * scale + yOffset) - halfHeight) / halfHeight)\n\n"
|
, " ~(((ypos * scale + yOffset) - halfHeight) / halfHeight)\n\n"
|
||||||
|
|
||||||
, " fun endYToNdc (yOffset, startY, endY, scale, halfHeight) =\n"
|
|
||||||
, " ~((((endY - startY) * scale + yOffset) - halfHeight) / halfHeight)\n\n"
|
|
||||||
|
|
||||||
, " fun lerp (xOffset, yOffset, scale, windowWidth, windowHeight) =\n"
|
, " fun lerp (xOffset, yOffset, scale, windowWidth, windowHeight) =\n"
|
||||||
, " let\n"
|
, " let\n"
|
||||||
, " val windowWidth = Real32.fromInt windowWidth\n"
|
, " val windowWidth = Real32.fromInt windowWidth\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user