port 'addCoordinates' function to app-update.sml
This commit is contained in:
@@ -245,6 +245,11 @@ struct
|
||||
case squares of
|
||||
{x, y, ex, ey, data = _} :: tl =>
|
||||
let
|
||||
val x = Real32.fromInt x
|
||||
val y = Real32.fromInt y
|
||||
val ex = Real32.fromInt ex
|
||||
val ey = Real32.fromInt ey
|
||||
|
||||
val startX = Ndc.fromPixelX (x, windowWidth, windowHeight)
|
||||
val endX = Ndc.fromPixelX (ex, windowWidth, windowHeight)
|
||||
val startY = Ndc.fromPixelY (y, windowWidth, windowHeight)
|
||||
@@ -256,7 +261,12 @@ struct
|
||||
end
|
||||
| [] => Vector.concat acc
|
||||
in
|
||||
fun toTriangles (windowWidth, windowHeight, squares) =
|
||||
fun toTriangles (windowWidth, windowHeight, squares, size) =
|
||||
let
|
||||
val qtree = build (0, 0, size, squares)
|
||||
val squares = toList qtree
|
||||
in
|
||||
loop (windowWidth, windowHeight, squares, [])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user