aboutsummaryrefslogtreecommitdiff
path: root/script.it
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2021-01-10 21:28:35 +0100
committerSébastien Dailly <sebastien@chimrod.com>2021-01-11 13:55:42 +0100
commit5ee27e786a3f1ed3eecc1e5c36f6e1e551388451 (patch)
tree4c409aee4bcc1aa018207ef86c0b529ed4bce860 /script.it
parent12e99cb08790b9e67913e4137da4a4dbcb82f362 (diff)
Correction in the bezier drawing
Diffstat (limited to 'script.it')
-rwxr-xr-xscript.it/script.ml9
-rwxr-xr-xscript.it/state.ml4
2 files changed, 7 insertions, 6 deletions
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 _ =
diff --git a/script.it/state.ml b/script.it/state.ml
index cc199d1..107a72b 100755
--- a/script.it/state.ml
+++ b/script.it/state.ml
@@ -325,8 +325,8 @@ let do_action
Layer.Paths.to_svg
~color:Blog.Nord.nord0
- (module Path.Fixed)
- path
+ (module Layer.Paths.ReprFixed)
+ (path, path)
state.rendering
)) in