Skip to content

Commit

Permalink
allow resetting the drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Feb 21, 2022
1 parent 026e2ca commit 13279b7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Main.elm
Expand Up @@ -44,6 +44,7 @@ type Msg
| SetNewMazeDifficulty Int
| NextMaze
| Draw (List Touch)
| ResetLines
| BackToGenerator


Expand Down Expand Up @@ -136,6 +137,11 @@ update msg model =
, Cmd.none
)

ResetLines ->
( { model | drawing = Dict.empty }
, Cmd.none
)

BackToGenerator ->
( model
, Navigation.pushUrl model.key (Route.toAbsolutePath Route.New)
Expand Down Expand Up @@ -244,7 +250,7 @@ viewMazeControls : Html Msg
viewMazeControls =
controlsBar
[ button [ Events.onClick BackToGenerator ] [ Html.text "Back to Generator" ]
, button [] [ Html.text "Reset Lines" ]
, button [ Events.onClick ResetLines ] [ Html.text "Reset Lines" ]
, button [ Events.onClick NextMaze ] [ Html.text "Next Maze" ]
]

Expand Down

0 comments on commit 13279b7

Please sign in to comment.