From 5ee27e786a3f1ed3eecc1e5c36f6e1e551388451 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sun, 10 Jan 2021 21:28:35 +0100 Subject: Correction in the bezier drawing --- script.it/script.ml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'script.it/script.ml') diff --git a/script.it/script.ml b/script.it/script.ml index ffdff9a..05bec1b 100755 --- a/script.it/script.ml +++ b/script.it/script.ml @@ -4,6 +4,7 @@ open Brr open Brr_note + (** Create the element in the page, and the event handler *) let canva : Brr.El.t -> [> State.canva_events] Note.E.t * (float * float) option Note.S.t * Brr_canvas.Canvas.t @@ -223,6 +224,7 @@ let on_change canva mouse_position timer state = end in + Layer.Paths.to_canva (module Path.Path_Builder) current context state.rendering; List.iter state.paths @@ -243,7 +245,7 @@ let on_change canva mouse_position timer state = | _ -> () in - Layer.Paths.to_canva (module Path.Fixed) path context state.rendering + Layer.Paths.to_canva (module Layer.Paths.ReprFixed) (path, path) context state.rendering ); let () = match state.mode with @@ -253,7 +255,7 @@ let on_change canva mouse_position timer state = state.paths ~f:(fun path -> if id = Path.Fixed.id path then - Layer.Paths.to_canva (module Path.Fixed) path context `Line + Layer.Paths.to_canva (module Layer.Paths.ReprFixed) (path, path) context `Line ) | Selection (Point (id, point)) -> (* As before, mark the selected path *) @@ -276,7 +278,7 @@ let on_change canva mouse_position timer state = | Some p -> p end | None -> path end in - Layer.Paths.to_canva (module Path.Fixed) path context `Line + Layer.Paths.to_canva (module Layer.Paths.ReprFixed) (path, path) context `Line ); (* Now draw the selected point *) @@ -389,7 +391,6 @@ let page_main id = |> Option.iter Logr.hold in - (* Ajust the angle slide according to the state *) let angle_signal = S.map (fun s -> Jstr.of_float s.State.angle) state in let _ = -- cgit v1.2.3