aboutsummaryrefslogtreecommitdiff
path: root/script.it/script_event/tick.ml
diff options
context:
space:
mode:
Diffstat (limited to 'script.it/script_event/tick.ml')
-rwxr-xr-xscript.it/script_event/tick.ml20
1 files changed, 20 insertions, 0 deletions
diff --git a/script.it/script_event/tick.ml b/script.it/script_event/tick.ml
new file mode 100755
index 0000000..c927a2a
--- /dev/null
+++ b/script.it/script_event/tick.ml
@@ -0,0 +1,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