2025-07-06 14:45:20 +01:00
|
|
|
structure NormalMode =
|
|
|
|
|
struct
|
|
|
|
|
open AppType
|
|
|
|
|
|
|
|
|
|
open DrawMessage
|
|
|
|
|
open FileMessage
|
|
|
|
|
open InputMessage
|
|
|
|
|
open UpdateMessage
|
|
|
|
|
|
|
|
|
|
fun getDotVecFromIndices (model: app_type, hIdx, vIdx) =
|
|
|
|
|
let
|
|
|
|
|
val {windowWidth, windowHeight, xClickPoints, yClickPoints, ...} = model
|
|
|
|
|
val xpos = Vector.sub (xClickPoints, hIdx)
|
|
|
|
|
val ypos = Vector.sub (yClickPoints, vIdx)
|
|
|
|
|
|
|
|
|
|
val endXpos =
|
|
|
|
|
if hIdx + 1 = Vector.length xClickPoints then xpos
|
|
|
|
|
else Vector.sub (xClickPoints, hIdx + 1)
|
|
|
|
|
|
|
|
|
|
val endYpos =
|
|
|
|
|
if vIdx + 1 = Vector.length yClickPoints then ypos
|
|
|
|
|
else Vector.sub (yClickPoints, vIdx + 1)
|
|
|
|
|
|
|
|
|
|
val tl = ClickPoints.getDrawDotRgb
|
|
|
|
|
(xpos, ypos, 0.0, 0.0, 1.0, windowWidth, windowHeight)
|
|
|
|
|
val tr = ClickPoints.getDrawDotRgb
|
|
|
|
|
(endXpos, ypos, 0.0, 0.0, 1.0, windowWidth, windowHeight)
|
|
|
|
|
val bl = ClickPoints.getDrawDotRgb
|
|
|
|
|
(xpos, endYpos, 0.0, 0.0, 1.0, windowWidth, windowHeight)
|
|
|
|
|
val br = ClickPoints.getDrawDotRgb
|
|
|
|
|
(endXpos, endYpos, 0.0, 0.0, 1.0, windowWidth, windowHeight)
|
|
|
|
|
in
|
|
|
|
|
Vector.concat [tl, tr, bl, br]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
fun mouseMoveOrRelease (model: app_type) =
|
|
|
|
|
let
|
|
|
|
|
val drawVec =
|
|
|
|
|
case ClickPoints.getClickPositionFromMouse model of
|
|
|
|
|
SOME (hIdx, vIdx) => getDotVecFromIndices (model, hIdx, vIdx)
|
|
|
|
|
| NONE => Vector.fromList []
|
|
|
|
|
|
|
|
|
|
val drawMsg = DRAW_DOT drawVec
|
|
|
|
|
val drawMsg = [DRAW drawMsg]
|
|
|
|
|
in
|
|
|
|
|
(model, drawMsg)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
fun getDrawDotMsgWhenArrowIsAtBoundary model =
|
|
|
|
|
let
|
|
|
|
|
val {arrowX, arrowY, ...} = model
|
|
|
|
|
val dotVec = getDotVecFromIndices (model, arrowX, arrowY)
|
|
|
|
|
val drawMsg = DRAW_DOT dotVec
|
|
|
|
|
val drawMsg = [DRAW drawMsg]
|
|
|
|
|
in
|
|
|
|
|
(model, drawMsg)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
fun moveArrowUp (model: app_type) =
|
|
|
|
|
let
|
|
|
|
|
val {arrowX, arrowY, ...} = model
|
|
|
|
|
in
|
|
|
|
|
if arrowY > 0 then
|
|
|
|
|
let
|
|
|
|
|
val newArrowY = arrowY - 1
|
|
|
|
|
val model = AppWith.arrowY (model, newArrowY)
|
|
|
|
|
|
|
|
|
|
val dotVec = getDotVecFromIndices (model, arrowX, newArrowY)
|
|
|
|
|
val drawMsg = DRAW_DOT dotVec
|
|
|
|
|
val drawMsg = [DRAW drawMsg]
|
|
|
|
|
in
|
|
|
|
|
(model, drawMsg)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
getDrawDotMsgWhenArrowIsAtBoundary model
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
fun moveArrowLeft (model: app_type) =
|
|
|
|
|
let
|
|
|
|
|
val {arrowX, arrowY, ...} = model
|
|
|
|
|
in
|
|
|
|
|
if arrowX > 0 then
|
|
|
|
|
let
|
|
|
|
|
val newArrowX = arrowX - 1
|
|
|
|
|
val model = AppWith.arrowX (model, newArrowX)
|
|
|
|
|
|
|
|
|
|
val dotVec = getDotVecFromIndices (model, newArrowX, arrowY)
|
|
|
|
|
val drawMsg = DRAW_DOT dotVec
|
|
|
|
|
val drawMsg = [DRAW drawMsg]
|
|
|
|
|
in
|
|
|
|
|
(model, drawMsg)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
getDrawDotMsgWhenArrowIsAtBoundary model
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
fun moveArrowRight (model: app_type) =
|
|
|
|
|
let
|
|
|
|
|
val {arrowX, arrowY, xClickPoints, ...} = model
|
|
|
|
|
in
|
|
|
|
|
if arrowX < Vector.length xClickPoints - 2 then
|
|
|
|
|
let
|
|
|
|
|
val newArrowX = arrowX + 1
|
|
|
|
|
val model = AppWith.arrowX (model, newArrowX)
|
|
|
|
|
|
|
|
|
|
val dotVec = getDotVecFromIndices (model, newArrowX, arrowY)
|
|
|
|
|
val drawMsg = DRAW_DOT dotVec
|
|
|
|
|
val drawMsg = [DRAW drawMsg]
|
|
|
|
|
in
|
|
|
|
|
(model, drawMsg)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
getDrawDotMsgWhenArrowIsAtBoundary model
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
fun moveArrowDown (model: app_type) =
|
|
|
|
|
let
|
|
|
|
|
val {arrowX, arrowY, yClickPoints, ...} = model
|
|
|
|
|
in
|
|
|
|
|
if arrowY < Vector.length yClickPoints - 2 then
|
|
|
|
|
let
|
|
|
|
|
val newArrowY = arrowY + 1
|
|
|
|
|
val model = AppWith.arrowY (model, newArrowY)
|
|
|
|
|
|
|
|
|
|
val dotVec = getDotVecFromIndices (model, arrowX, newArrowY)
|
|
|
|
|
val drawMsg = DRAW_DOT dotVec
|
|
|
|
|
val drawMsg = [DRAW drawMsg]
|
|
|
|
|
in
|
|
|
|
|
(model, drawMsg)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
getDrawDotMsgWhenArrowIsAtBoundary model
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
fun realToInt x = Real32.toInt IEEEReal.TO_NEAREST x
|
|
|
|
|
|
2025-08-09 13:50:31 +01:00
|
|
|
fun getDrawMessage (model: app_type, initialMsg) =
|
2025-07-06 14:45:20 +01:00
|
|
|
let
|
|
|
|
|
val
|
2025-08-09 11:42:37 +01:00
|
|
|
{ canvasWidth
|
|
|
|
|
, canvasHeight
|
|
|
|
|
, layerTree
|
|
|
|
|
, windowWidth
|
2025-07-06 14:45:20 +01:00
|
|
|
, windowHeight
|
|
|
|
|
, xClickPoints
|
|
|
|
|
, yClickPoints
|
2025-08-09 11:42:37 +01:00
|
|
|
, arrowX
|
|
|
|
|
, arrowY
|
2025-07-06 14:45:20 +01:00
|
|
|
, ...
|
|
|
|
|
} = model
|
|
|
|
|
|
2025-08-09 09:32:34 +01:00
|
|
|
val maxSide = Int.max (canvasWidth, canvasHeight)
|
|
|
|
|
val squares = LayerTree.flatten (maxSide, layerTree)
|
2025-07-06 14:45:20 +01:00
|
|
|
|
2025-08-09 11:42:37 +01:00
|
|
|
val dotVec = getDotVecFromIndices (model, arrowX, arrowY)
|
2025-07-06 14:45:20 +01:00
|
|
|
|
2025-07-11 00:57:55 +01:00
|
|
|
val squares = CollisionTree.toTriangles
|
|
|
|
|
( windowWidth
|
|
|
|
|
, windowHeight
|
|
|
|
|
, squares
|
|
|
|
|
, maxSide
|
|
|
|
|
, canvasWidth
|
|
|
|
|
, canvasHeight
|
|
|
|
|
, xClickPoints
|
|
|
|
|
, yClickPoints
|
|
|
|
|
)
|
2025-07-06 14:45:20 +01:00
|
|
|
val drawMsg = DRAW_SQUARES_AND_DOTS {squares = squares, dots = dotVec}
|
2025-08-09 13:50:31 +01:00
|
|
|
val drawMsg = DRAW (drawMsg) :: initialMsg
|
2025-07-06 14:45:20 +01:00
|
|
|
in
|
2025-08-09 13:50:31 +01:00
|
|
|
(model, drawMsg)
|
2025-07-06 14:45:20 +01:00
|
|
|
end
|
|
|
|
|
|
2025-08-09 11:42:37 +01:00
|
|
|
fun changePixel (model: app_type, hIdx, vIdx, pixel) =
|
|
|
|
|
let
|
|
|
|
|
val {canvasWidth, canvasHeight, layer, layerTree, ...} = model
|
|
|
|
|
|
|
|
|
|
val maxSide = Int.max (canvasWidth, canvasHeight)
|
|
|
|
|
|
|
|
|
|
val layerTree = LayerTree.addPixel
|
|
|
|
|
(layer, hIdx, vIdx, maxSide, pixel, layerTree)
|
|
|
|
|
val model = AppWith.layerTree (model, layerTree, hIdx, vIdx)
|
|
|
|
|
in
|
2025-08-09 13:50:31 +01:00
|
|
|
getDrawMessage (model, [])
|
2025-08-09 11:42:37 +01:00
|
|
|
end
|
|
|
|
|
|
2025-08-09 09:32:34 +01:00
|
|
|
fun addPixel (model: app_type, hIdx, vIdx) =
|
|
|
|
|
let
|
|
|
|
|
val {r, g, b, a, ...} = model
|
|
|
|
|
val pixel = {r = r, g = g, b = b, a = a}
|
|
|
|
|
in
|
|
|
|
|
changePixel (model, hIdx, vIdx, pixel)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
fun deletePixel (model, hIdx, vIdx) =
|
|
|
|
|
changePixel (model, hIdx, vIdx, Grid.emptyPixel)
|
2025-07-11 23:55:12 +01:00
|
|
|
|
2025-07-06 14:45:20 +01:00
|
|
|
fun mouseLeftClick model =
|
|
|
|
|
case ClickPoints.getClickPositionFromMouse model of
|
2025-08-09 09:32:34 +01:00
|
|
|
SOME (hIdx, vIdx) => addPixel (model, hIdx, vIdx)
|
2025-07-06 14:45:20 +01:00
|
|
|
| NONE => (model, [])
|
|
|
|
|
|
|
|
|
|
fun enterOrSpaceCoordinates model =
|
|
|
|
|
let val {arrowX, arrowY, ...} = model
|
2025-08-09 09:32:34 +01:00
|
|
|
in addPixel (model, arrowX, arrowY)
|
2025-07-06 14:45:20 +01:00
|
|
|
end
|
|
|
|
|
|
2025-07-11 23:47:28 +01:00
|
|
|
fun backspace model =
|
|
|
|
|
let val {arrowX, arrowY, ...} = model
|
|
|
|
|
in deletePixel (model, arrowX, arrowY)
|
|
|
|
|
end
|
|
|
|
|
|
2025-07-06 14:45:20 +01:00
|
|
|
fun resizeWindow (model, width, height) =
|
|
|
|
|
let
|
|
|
|
|
val model = AppWith.windowResize (model, width, height)
|
2025-08-09 07:17:48 +01:00
|
|
|
val {arrowX, arrowY, ...} = model
|
2025-07-06 14:45:20 +01:00
|
|
|
val dots = getDotVecFromIndices (model, arrowX, arrowY)
|
|
|
|
|
in
|
2025-08-09 07:17:48 +01:00
|
|
|
CommonUpdate.resizeWindow (model, width, height, dots)
|
2025-07-06 14:45:20 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
fun undoAction model = (model, [])
|
|
|
|
|
|
|
|
|
|
fun redoAction model = (model, [])
|
|
|
|
|
|
|
|
|
|
fun toggleGraph (model: app_type) =
|
|
|
|
|
if #showGraph model then
|
|
|
|
|
let
|
|
|
|
|
val model = AppWith.graphVisibility (model, false)
|
|
|
|
|
val drawMsg = DRAW_GRAPH (Vector.fromList [])
|
|
|
|
|
val drawMsg = [DRAW drawMsg]
|
|
|
|
|
in
|
|
|
|
|
(model, drawMsg)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
let
|
|
|
|
|
val model = AppWith.graphVisibility (model, true)
|
|
|
|
|
val graphLines = GraphLines.generate model
|
|
|
|
|
val drawMsg = DRAW_GRAPH graphLines
|
|
|
|
|
val drawMsg = [DRAW drawMsg]
|
|
|
|
|
in
|
|
|
|
|
(model, drawMsg)
|
|
|
|
|
end
|
|
|
|
|
|
2025-07-11 17:30:57 +01:00
|
|
|
fun updateNum (model: app_type, newNum) =
|
2025-07-11 17:41:47 +01:00
|
|
|
(AppWith.modalNum (model, newNum), [])
|
2025-07-06 14:45:20 +01:00
|
|
|
|
2025-08-09 08:36:14 +01:00
|
|
|
fun clearNum model = updateNum (model, 0)
|
|
|
|
|
|
2025-07-06 14:45:20 +01:00
|
|
|
fun updateRed model = (AppWith.r model, [])
|
|
|
|
|
fun updateGreen model = (AppWith.g model, [])
|
|
|
|
|
fun updateBlue model = (AppWith.b model, [])
|
2025-07-11 15:34:29 +01:00
|
|
|
fun updateAlpha model = (AppWith.a model, [])
|
2025-08-09 08:36:14 +01:00
|
|
|
fun changeLayer model = (AppWith.layer model, [])
|
2025-07-06 14:45:20 +01:00
|
|
|
|
2025-08-09 07:04:03 +01:00
|
|
|
fun selectCursorColour (model: app_type) =
|
|
|
|
|
let
|
2025-08-09 10:11:37 +01:00
|
|
|
val {layer, layerTree, arrowX, arrowY, ...} = model
|
2025-08-09 07:04:03 +01:00
|
|
|
in
|
2025-08-09 10:11:37 +01:00
|
|
|
case LayerTree.get (layer, layerTree) of
|
|
|
|
|
SOME grid =>
|
|
|
|
|
let
|
|
|
|
|
val yAxis = Vector.sub (grid, arrowX)
|
|
|
|
|
val {r, g, b, a} = Vector.sub (yAxis, arrowY)
|
|
|
|
|
val model = AppWith.cursorColour (model, r, g, b, a)
|
|
|
|
|
in
|
|
|
|
|
(model, [])
|
|
|
|
|
end
|
|
|
|
|
| NONE => (model, [])
|
2025-08-09 07:04:03 +01:00
|
|
|
end
|
|
|
|
|
|
2025-07-11 22:57:20 +01:00
|
|
|
fun updateCanvas (model, canvasWidth, canvasHeight) =
|
2025-07-11 17:41:47 +01:00
|
|
|
let
|
|
|
|
|
val
|
|
|
|
|
{ arrowX
|
|
|
|
|
, arrowY
|
|
|
|
|
, windowWidth
|
|
|
|
|
, windowHeight
|
|
|
|
|
, xClickPoints
|
|
|
|
|
, yClickPoints
|
|
|
|
|
, showGraph
|
2025-08-09 10:11:37 +01:00
|
|
|
, layerTree
|
2025-07-11 17:41:47 +01:00
|
|
|
, ...
|
|
|
|
|
} = model
|
|
|
|
|
|
2025-07-11 22:57:20 +01:00
|
|
|
val dotVec = getDotVecFromIndices (model, arrowX, arrowY)
|
2025-07-11 17:41:47 +01:00
|
|
|
val graphLines =
|
|
|
|
|
if showGraph then GraphLines.generate model else Vector.fromList []
|
|
|
|
|
|
|
|
|
|
val maxSide = Int.max (canvasWidth, canvasHeight)
|
2025-08-09 10:11:37 +01:00
|
|
|
val squares = LayerTree.flatten (maxSide, layerTree)
|
|
|
|
|
|
2025-07-11 17:41:47 +01:00
|
|
|
val squares = CollisionTree.toTriangles
|
|
|
|
|
( windowWidth
|
|
|
|
|
, windowHeight
|
|
|
|
|
, squares
|
|
|
|
|
, maxSide
|
|
|
|
|
, canvasWidth
|
|
|
|
|
, canvasHeight
|
|
|
|
|
, xClickPoints
|
|
|
|
|
, yClickPoints
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
val msg =
|
|
|
|
|
RESIZE_SQUARES_DOTS_AND_GRAPH
|
|
|
|
|
{squares = squares, dots = dotVec, graphLines = graphLines}
|
|
|
|
|
in
|
|
|
|
|
(model, [DRAW msg])
|
|
|
|
|
end
|
|
|
|
|
|
2025-07-11 22:57:20 +01:00
|
|
|
fun updateCanvasWidth model =
|
|
|
|
|
let
|
2025-08-09 10:11:37 +01:00
|
|
|
val {modalNum, layerTree, canvasHeight, ...} = model
|
|
|
|
|
val newCanvasWidth = modalNum
|
|
|
|
|
|
|
|
|
|
val maxSide = Int.max (newCanvasWidth, canvasHeight)
|
|
|
|
|
val layerTree = LayerTree.changeGridSize (maxSide, layerTree)
|
|
|
|
|
|
|
|
|
|
val model = AppWith.canvasWidth (model, newCanvasWidth, layerTree)
|
2025-07-12 07:17:52 +01:00
|
|
|
val {canvasWidth, canvasHeight, ...} = model
|
2025-07-11 22:57:20 +01:00
|
|
|
in
|
|
|
|
|
updateCanvas (model, canvasWidth, canvasHeight)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
fun updateCanvasHeight model =
|
|
|
|
|
let
|
2025-08-09 10:11:37 +01:00
|
|
|
val {modalNum, layerTree, canvasWidth, ...} = model
|
|
|
|
|
val newCanvasHeight = modalNum
|
|
|
|
|
|
|
|
|
|
val maxSide = Int.max (newCanvasHeight, canvasWidth)
|
|
|
|
|
val layerTree = LayerTree.changeGridSize (maxSide, layerTree)
|
|
|
|
|
|
|
|
|
|
val model = AppWith.canvasHeight (model, newCanvasHeight, layerTree)
|
2025-07-12 07:17:52 +01:00
|
|
|
val {canvasWidth, canvasHeight, ...} = model
|
|
|
|
|
in
|
|
|
|
|
updateCanvas (model, canvasWidth, canvasHeight)
|
|
|
|
|
end
|
|
|
|
|
|
2025-08-09 11:42:37 +01:00
|
|
|
fun useLayers (model, layerTree, canvasWidth, canvasHeight) =
|
|
|
|
|
let
|
|
|
|
|
val model =
|
2025-08-09 13:08:26 +01:00
|
|
|
AppWith.parsedLayerTree (model, layerTree, canvasWidth, canvasHeight)
|
2025-08-09 13:50:31 +01:00
|
|
|
|
|
|
|
|
val graphLines =
|
|
|
|
|
if #showGraph model then GraphLines.generate model
|
|
|
|
|
else Vector.fromList []
|
|
|
|
|
val initialMsg = DRAW_GRAPH graphLines
|
|
|
|
|
val initialMsg = [DRAW initialMsg]
|
2025-08-09 11:42:37 +01:00
|
|
|
in
|
2025-08-09 13:50:31 +01:00
|
|
|
getDrawMessage (model, initialMsg)
|
2025-08-09 11:42:37 +01:00
|
|
|
end
|
2025-07-11 17:41:47 +01:00
|
|
|
|
2025-07-06 14:45:20 +01:00
|
|
|
fun enterBrowseMode model =
|
|
|
|
|
let
|
|
|
|
|
val model = AppWith.mode (model, AppType.BROWSE_MODE)
|
|
|
|
|
(* todo: should draw modal window as well *)
|
|
|
|
|
val fileMsg = LOAD_FILES (#openFilePath model)
|
|
|
|
|
val fileMsg = [FILE fileMsg]
|
|
|
|
|
in
|
|
|
|
|
(model, fileMsg)
|
|
|
|
|
end
|
|
|
|
|
|
2025-08-09 00:13:02 +01:00
|
|
|
fun enterMoveMode model =
|
|
|
|
|
let val model = AppWith.mode (model, AppType.MOVE_MODE)
|
|
|
|
|
in (model, [])
|
|
|
|
|
end
|
|
|
|
|
|
2025-07-06 14:45:20 +01:00
|
|
|
fun handleFileBrowserAndPathInNormalMode (model, fileBrowser, path) =
|
|
|
|
|
let val model = AppWith.fileBrowserAndPath (model, fileBrowser, path)
|
|
|
|
|
in (model, [])
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
fun update (model: app_type, inputMsg) =
|
|
|
|
|
case inputMsg of
|
|
|
|
|
MOUSE_MOVE {x = mouseX, y = mouseY} =>
|
|
|
|
|
let val model = AppWith.mousePosition (model, mouseX, mouseY)
|
|
|
|
|
in mouseMoveOrRelease model
|
|
|
|
|
end
|
|
|
|
|
| MOUSE_LEFT_RELEASE => mouseMoveOrRelease model
|
|
|
|
|
| MOUSE_LEFT_CLICK => mouseLeftClick model
|
|
|
|
|
| NUM num => updateNum (model, num)
|
2025-08-09 08:36:14 +01:00
|
|
|
| KEY_ESC => clearNum model
|
2025-07-06 14:45:20 +01:00
|
|
|
| KEY_R => updateRed model
|
|
|
|
|
| KEY_G => updateGreen model
|
|
|
|
|
| KEY_B => updateBlue model
|
2025-07-11 15:34:29 +01:00
|
|
|
| KEY_A => updateAlpha model
|
2025-08-09 08:36:14 +01:00
|
|
|
| KEY_L => changeLayer model
|
2025-08-09 07:04:03 +01:00
|
|
|
| KEY_C => selectCursorColour model
|
2025-07-11 17:45:16 +01:00
|
|
|
| KEY_W => updateCanvasWidth model
|
2025-07-11 22:57:20 +01:00
|
|
|
| KEY_H => updateCanvasHeight model
|
2025-08-09 00:13:02 +01:00
|
|
|
| KEY_M => enterMoveMode model
|
2025-07-06 14:45:20 +01:00
|
|
|
| RESIZE_WINDOW {width, height} => resizeWindow (model, width, height)
|
|
|
|
|
| UNDO_ACTION => undoAction model
|
|
|
|
|
| REDO_ACTION => redoAction model
|
|
|
|
|
| KEY_T => toggleGraph model
|
|
|
|
|
| KEY_CTRL_S => CommonUpdate.getSaveSquaresMsg model
|
|
|
|
|
| KEY_CTRL_L => CommonUpdate.getLoadSquaresMsg model
|
|
|
|
|
| KEY_CTRL_E => CommonUpdate.getExportSquaresMsg model
|
2025-07-13 15:33:32 +01:00
|
|
|
| KEY_CTRL_C => CommonUpdate.getCollisionMsg model
|
2025-08-09 11:42:37 +01:00
|
|
|
| USE_LAYERS {tree, canvasWidth, canvasHeight} =>
|
|
|
|
|
useLayers (model, tree, canvasWidth, canvasHeight)
|
2025-07-06 14:45:20 +01:00
|
|
|
| SQUARES_LOAD_ERROR => CommonUpdate.squaresLoadError model
|
|
|
|
|
| KEY_CTRL_O => enterBrowseMode model
|
|
|
|
|
| ARROW_UP => moveArrowUp model
|
|
|
|
|
| ARROW_LEFT => moveArrowLeft model
|
|
|
|
|
| ARROW_RIGHT => moveArrowRight model
|
|
|
|
|
| ARROW_DOWN => moveArrowDown model
|
2025-07-11 23:47:28 +01:00
|
|
|
| KEY_BACKSPACE => backspace model
|
2025-07-06 14:45:20 +01:00
|
|
|
| KEY_ENTER => enterOrSpaceCoordinates model
|
|
|
|
|
| KEY_SPACE => enterOrSpaceCoordinates model
|
|
|
|
|
| FILE_BROWSER_AND_PATH {fileBrowser, path} =>
|
|
|
|
|
handleFileBrowserAndPathInNormalMode (model, fileBrowser, path)
|
|
|
|
|
end
|