fix exception that was previously triggered when trying to insert after loading a parsed tree, by making sure that the arrowX and arrowY fields are clamped by the new canvas width and height
This commit is contained in:
@@ -1000,7 +1000,7 @@ struct
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
fun useLayerTree (app: app_type, layerTree, canvasWidth, canvasHeight) :
|
fun parsedLayerTree (app: app_type, layerTree, canvasWidth, canvasHeight) :
|
||||||
app_type =
|
app_type =
|
||||||
let
|
let
|
||||||
val
|
val
|
||||||
@@ -1028,6 +1028,11 @@ struct
|
|||||||
, layerTree = _
|
, layerTree = _
|
||||||
, modalNum
|
, modalNum
|
||||||
} = app
|
} = app
|
||||||
|
|
||||||
|
val arrowX =
|
||||||
|
if canvasWidth = 0 then 0 else Int.min (canvasWidth - 1, arrowX)
|
||||||
|
val arrowY =
|
||||||
|
if canvasHeight = 0 then 0 else Int.min (canvasHeight - 1, arrowY)
|
||||||
in
|
in
|
||||||
{ mode = mode
|
{ mode = mode
|
||||||
, mouseX = mouseX
|
, mouseX = mouseX
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ struct
|
|||||||
fun useLayers (model, layerTree, canvasWidth, canvasHeight) =
|
fun useLayers (model, layerTree, canvasWidth, canvasHeight) =
|
||||||
let
|
let
|
||||||
val model =
|
val model =
|
||||||
AppWith.layerTree (model, layerTree, canvasWidth, canvasHeight)
|
AppWith.parsedLayerTree (model, layerTree, canvasWidth, canvasHeight)
|
||||||
in
|
in
|
||||||
getDrawMessage model
|
getDrawMessage model
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user