improve graph lines

This commit is contained in:
2025-07-06 17:50:46 +01:00
parent 6a6a36a277
commit dc2a52bcc8
5 changed files with 109 additions and 121 deletions

View File

@@ -160,7 +160,8 @@ struct
val maxSide = Int.max (canvasWidth, canvasHeight)
val squares =
CollisionTree.toTriangles (windowWidth, windowHeight, squares, maxSide)
CollisionTree.toTriangles (windowWidth, windowHeight, squares, maxSide,
canvasWidth, canvasHeight, xClickPoints, yClickPoints)
val drawMsg = DRAW_SQUARES_AND_DOTS {squares = squares, dots = dotVec}
in
(model, [DRAW drawMsg])
@@ -180,11 +181,13 @@ struct
let
val model = AppWith.windowResize (model, width, height)
val {squares, canvasWidth, canvasHeight, showGraph, arrowX, arrowY, ...} =
val {squares, canvasWidth, canvasHeight, showGraph, arrowX, arrowY,
xClickPoints, yClickPoints, ...} =
model
val maxSide = Int.max (canvasWidth, canvasHeight)
val squares = CollisionTree.toTriangles (width, height, squares, maxSide)
val squares = CollisionTree.toTriangles (width, height, squares, maxSide,
canvasWidth, canvasHeight, xClickPoints, yClickPoints)
val graphLines =
if showGraph then GraphLines.generate model else Vector.fromList []