From af88c8895bba85fe5340b34aafb3dce7650bd01f Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Fri, 1 Jan 2021 11:08:38 +0100 Subject: Use first type module instead of functors --- script.ml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'script.ml') diff --git a/script.ml b/script.ml index d7d969c..595d975 100755 --- a/script.ml +++ b/script.ml @@ -4,9 +4,6 @@ open Brr open Brr_note -module Path_Printer = Paths.Path_Builder.Draw(Paths.CanvaRepr) -module Fixed_Printer = Paths.Fixed.DrawFixed(Paths.CanvaRepr) - module Mouse = Brr_note_kit.Mouse let get_height el = @@ -168,7 +165,6 @@ let green = Jstr.v "#a3be8c" (** Redraw the canva on update *) let on_change canva mouse_position state = - let module Path' = Path in let open Brr_canvas.C2d in let w, h = Brr_canvas.Canvas.(float_of_int @@ w canva, float_of_int @@ h canva) in @@ -202,8 +198,9 @@ let on_change canva mouse_position state = in let path = Paths.CanvaRepr.get - @@ Path_Printer.draw + @@ Paths.Path_Builder.repr current + (module Paths.CanvaRepr) (Paths.CanvaRepr.create_path (fun p -> fill context p)) in stroke context path; @@ -211,8 +208,8 @@ let on_change canva mouse_position state = ~f:(fun path -> let () = match state.mode with - | Selection s -> - begin match (Paths.Fixed.id s) = (Paths.Fixed.id path) with + | Selection id -> + begin match id = (Paths.Fixed.id path) with | true -> (* If the element is the selected one, change the color *) set_fill_style context (color Blog.Nord.nord8); @@ -225,8 +222,9 @@ let on_change canva mouse_position state = in let path = Paths.CanvaRepr.get - @@ Fixed_Printer.draw + @@ Paths.Fixed.repr path + (module Paths.CanvaRepr) (Paths.CanvaRepr.create_path (fun p -> fill context p)) in stroke context path; ); -- cgit v1.2.3