add functionality to resize window in move mode
This commit is contained in:
@@ -7,6 +7,43 @@ struct
|
||||
open InputMessage
|
||||
open UpdateMessage
|
||||
|
||||
fun resizeWindow (model, width, height, dots) =
|
||||
let
|
||||
val
|
||||
{ squares
|
||||
, canvasWidth
|
||||
, canvasHeight
|
||||
, showGraph
|
||||
, arrowX
|
||||
, arrowY
|
||||
, xClickPoints
|
||||
, yClickPoints
|
||||
, ...
|
||||
} = model
|
||||
val maxSide = Int.max (canvasWidth, canvasHeight)
|
||||
|
||||
val squares = CollisionTree.toTriangles
|
||||
( width
|
||||
, height
|
||||
, squares
|
||||
, maxSide
|
||||
, canvasWidth
|
||||
, canvasHeight
|
||||
, xClickPoints
|
||||
, yClickPoints
|
||||
)
|
||||
|
||||
val graphLines =
|
||||
if showGraph then GraphLines.generate model else Vector.fromList []
|
||||
|
||||
val drawMsg =
|
||||
RESIZE_SQUARES_DOTS_AND_GRAPH
|
||||
{squares = squares, graphLines = graphLines, dots = dots}
|
||||
val drawMsg = [DRAW drawMsg]
|
||||
in
|
||||
(model, drawMsg)
|
||||
end
|
||||
|
||||
fun getSaveSquaresMsg (model: app_type) =
|
||||
let
|
||||
val {canvasWidth, canvasHeight, squares, ...} = model
|
||||
|
||||
Reference in New Issue
Block a user