diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2021-01-01 11:08:38 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2021-01-01 11:08:38 +0100 |
commit | af88c8895bba85fe5340b34aafb3dce7650bd01f (patch) | |
tree | ee0c9d1bd463242c681c6202a9a57c8110d58f59 /script.ml | |
parent | e25b7797708c19cbaef68c14ebef8738de44c2d9 (diff) |
Use first type module instead of functors
Diffstat (limited to 'script.ml')
-rwxr-xr-x | script.ml | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -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; ); |