scaffolding in preparation for implementing undo

This commit is contained in:
2024-08-08 06:34:40 +01:00
parent a53c5e1ce3
commit 5c7c61586a
10 changed files with 53 additions and 10 deletions

View File

@@ -23,6 +23,7 @@ struct
, xClickPoints = xClickPoints
, yClickPoints = yClickPoints
, graphLines = graphLines
, undo = []
}
end

View File

@@ -23,6 +23,7 @@ sig
, xClickPoints: Real32.real vector
, yClickPoints: Real32.real vector
, graphLines: Real32.real vector
, undo: (int * int) list
}
end
@@ -59,5 +60,6 @@ struct
, xClickPoints: Real32.real vector
, yClickPoints: Real32.real vector
, graphLines: Real32.real vector
, undo: (int * int) list
}
end

View File

@@ -103,4 +103,10 @@ struct
| MOUSE_LEFT_CLICK => mouseLeftClick (model, mouseX, mouseY)
| RESIZE_WINDOW {width, height} =>
resizeWindow (model, mouseX, mouseY, width, height)
| UNDO_ACTION =>
let
val _ = print "undo action\n"
in
(model, NO_DRAW, mouseX, mouseY)
end
end

View File

@@ -28,6 +28,7 @@ struct
, windowWidth
, windowHeight
, graphLines
, undo
} = app
in
{ triangleStage = newTriangleStage
@@ -37,6 +38,7 @@ struct
, windowWidth = windowWidth
, windowHeight = windowHeight
, graphLines = graphLines
, undo = undo
}
end
@@ -50,6 +52,7 @@ struct
, windowWidth
, windowHeight
, graphLines
, undo
} = app
val newTriangle = {x1 = x1, y1 = y1, x2 = x2, y2 = y2, x3 = x3, y3 = y3}
@@ -62,6 +65,7 @@ struct
, windowWidth = windowWidth
, windowHeight = windowHeight
, graphLines = graphLines
, undo = undo
}
end
@@ -77,6 +81,7 @@ struct
, graphLines = _
, triangles
, triangleStage
, undo
} = app
val xClickPoints = ClickPoints.generate (wStart, wFinish)
val yClickPoints = ClickPoints.generate (hStart, hFinish)
@@ -91,6 +96,7 @@ struct
, triangleStage = triangleStage
, windowWidth = windowWidth
, windowHeight = windowHeight
, undo = undo
}
end