aboutsummaryrefslogtreecommitdiff
path: root/script.it/script_event/tick.ml
blob: c927a2a0593dbbb2c85c651ba2b91d4d14dc4b75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module State = Script_state.State

type t = float * (float * float)

(** Tick event

    Tick only occurs when drawing a new path

*)
let update (delay, point) state =
  match state.State.mode with
  | Edit ->
    (* Add the point in the list *)
    let current = State.insert_or_replace
        state
        point
        delay
        state.current in
    { state with current }
  | _ -> state