aboutsummaryrefslogtreecommitdiff
path: root/script.ml
diff options
context:
space:
mode:
Diffstat (limited to 'script.ml')
-rwxr-xr-xscript.ml14
1 files changed, 6 insertions, 8 deletions
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;
);