silly little doodles
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add mirror cycle button

nnuuvv 04503dd9 29cb3db5

+17 -5
+17 -5
src/doodler.gleam
··· 48 48 type Msg { 49 49 UserClickedPoint(Point) 50 50 // TODO: add button to toggle 51 - UserClickedToggleMirror 51 + UserClickedCycleMirror 52 52 // TODO: implement 'shape verification mode' toggle 53 53 } 54 54 ··· 97 97 Model(points:, edges:, selected: None, mirroring:) 98 98 } 99 99 // cycle mirroring 100 - UserClickedToggleMirror, Model(_, _, _, Off) -> 100 + UserClickedCycleMirror, Model(_, _, _, Off) -> 101 101 Model(..model, mirroring: Vertical) 102 - UserClickedToggleMirror, Model(_, _, _, Vertical) -> 102 + UserClickedCycleMirror, Model(_, _, _, Vertical) -> 103 103 Model(..model, mirroring: Horizontal) 104 - UserClickedToggleMirror, Model(_, _, _, Horizontal) -> 104 + UserClickedCycleMirror, Model(_, _, _, Horizontal) -> 105 105 Model(..model, mirroring: Both) 106 - UserClickedToggleMirror, Model(_, _, _, Both) -> 106 + UserClickedCycleMirror, Model(_, _, _, Both) -> 107 107 Model(..model, mirroring: Off) 108 108 } 109 109 } ··· 260 260 <> int.to_string(int.absolute_value(min_y) + max_y) 261 261 262 262 div([], [ 263 + html.button([on_click(UserClickedCycleMirror)], [ 264 + html.text("Mirroring: " <> model.mirroring |> mirroring_to_string), 265 + ]), 263 266 svg.svg( 264 267 [ 265 268 attribute.attribute("width", "97vw"), ··· 276 279 ]), 277 280 ), 278 281 ]) 282 + } 283 + 284 + fn mirroring_to_string(mirroring: Mirroring) -> String { 285 + case mirroring { 286 + Off -> "Off" 287 + Vertical -> "Vertical" 288 + Horizontal -> "Horizontal" 289 + Both -> "Both" 290 + } 279 291 } 280 292 281 293 /// turn simple Point(x,y) grid coords into 'display grid' by appling point_spacing