update 'changeCanvasWidth/Height' functions to use layer tree

This commit is contained in:
2025-08-09 10:11:37 +01:00
parent 21624aee0d
commit ab888f8410
3 changed files with 34 additions and 19 deletions

View File

@@ -875,7 +875,7 @@ struct
}
end
fun canvasWidth (app: app_type, newCanvasWidth) =
fun canvasWidth (app: app_type, newCanvasWidth, newLayerTree) =
let
val
{ mode
@@ -900,11 +900,10 @@ struct
, b
, a
, layer
, layerTree
, layerTree = _
, modalNum
} = app
val squares = changeSquaresSize (squares, newCanvasWidth, canvasHeight)
val arrowX = Int.min (arrowX, newCanvasWidth)
val (xClickPoints, yClickPoints) =
ClickPoints.generate
@@ -932,12 +931,12 @@ struct
, b = b
, a = a
, layer = layer
, layerTree = layerTree
, layerTree = newLayerTree
, modalNum = 0
}
end
fun canvasHeight (app: app_type, newCanvasHeight) =
fun canvasHeight (app: app_type, newCanvasHeight, newLayerTree) =
let
val
{ mode
@@ -962,11 +961,10 @@ struct
, b
, a
, layer
, layerTree
, layerTree = _
, modalNum
} = app
val squares = changeSquaresSize (squares, canvasWidth, newCanvasHeight)
val arrowY = Int.min (arrowY, newCanvasHeight)
val (xClickPoints, yClickPoints) =
ClickPoints.generate
@@ -994,7 +992,7 @@ struct
, b = b
, a = a
, layer = layer
, layerTree = layerTree
, layerTree = newLayerTree
, modalNum = 0
}
end