add functionality for changing height of canvas

This commit is contained in:
2025-07-11 22:57:20 +01:00
parent a448fcf469
commit 86369db055
7 changed files with 92 additions and 6 deletions

View File

@@ -895,6 +895,68 @@ struct
}
end
fun canvasHeight (app: app_type, newCanvasHeight) =
let
val
{ mode
, canvasHeight = _
, canvasWidth
, squares
, arrowX
, arrowY
, windowWidth
, windowHeight
, xClickPoints
, yClickPoints
, showGraph
, mouseX
, mouseY
, openFilePath
, fileBrowser
, fileBrowserIdx
, r
, g
, b
, a
, modalNum
, undo
, redo
} = app
val squares = changeSquaresSize (squares, canvasWidth, newCanvasHeight)
val arrowY = Int.min (arrowY, newCanvasHeight)
val (xClickPoints, yClickPoints) =
ClickPoints.generate
(windowWidth, windowHeight, canvasWidth, newCanvasHeight)
in
{ mode = mode
, canvasHeight = newCanvasHeight
, canvasWidth = canvasWidth
, arrowX = arrowX
, mouseX = mouseX
, mouseY = mouseY
, squares = squares
, arrowY = arrowY
, windowWidth = windowWidth
, windowHeight = windowHeight
, xClickPoints = xClickPoints
, yClickPoints = yClickPoints
, showGraph = showGraph
, openFilePath = openFilePath
, fileBrowser = fileBrowser
, fileBrowserIdx = fileBrowserIdx
, r = r
, g = g
, b = b
, a = a
, modalNum = 0
, undo = undo
, redo = redo
}
end
(* todo:
fun useSquaresAndSetNormalMode (app: app_type, squares, canvasWidth, canvasHeight) =
*)