add functionality to resize window in move mode
This commit is contained in:
@@ -194,42 +194,10 @@ struct
|
||||
fun resizeWindow (model, width, height) =
|
||||
let
|
||||
val model = AppWith.windowResize (model, width, height)
|
||||
|
||||
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 {arrowX, arrowY, ...} = model
|
||||
val dots = getDotVecFromIndices (model, arrowX, arrowY)
|
||||
|
||||
val drawMsg =
|
||||
RESIZE_SQUARES_DOTS_AND_GRAPH
|
||||
{squares = squares, graphLines = graphLines, dots = dots}
|
||||
val drawMsg = [DRAW drawMsg]
|
||||
in
|
||||
(model, drawMsg)
|
||||
CommonUpdate.resizeWindow (model, width, height, dots)
|
||||
end
|
||||
|
||||
fun undoAction model = (model, [])
|
||||
|
||||
Reference in New Issue
Block a user