aboutsummaryrefslogtreecommitdiff
path: root/script.it/script.ml
diff options
context:
space:
mode:
Diffstat (limited to 'script.it/script.ml')
-rwxr-xr-xscript.it/script.ml23
1 files changed, 13 insertions, 10 deletions
diff --git a/script.it/script.ml b/script.it/script.ml
index 9ef15fe..3859cc9 100755
--- a/script.it/script.ml
+++ b/script.it/script.ml
@@ -225,7 +225,10 @@ let on_change canva mouse_position timer state =
in
- Layer.Paths.to_canva (module Layer.Paths.ReprBuild) (current, current) context state.rendering;
+ let back = Path.Path_Builder.map
+ current
+ (fun pt -> Path.Point.copy pt @@ Path.Point.get_coord' pt) in
+ Layer.Paths.to_canva (module Path.Path_Builder) (current, back) context state.rendering;
List.iter state.paths
~f:(fun path ->
@@ -246,7 +249,7 @@ let on_change canva mouse_position timer state =
in
let p = path.Outline.path in
- Layer.Paths.to_canva (module Layer.Paths.ReprFixed) (p, p) context state.rendering
+ Layer.Paths.to_canva (module Path.Fixed) (p, path.Outline.back) context state.rendering
);
let () = match state.mode with
@@ -257,7 +260,7 @@ let on_change canva mouse_position timer state =
~f:(fun path ->
if id = path.Outline.id then
let p = path.Outline.path in
- Layer.Paths.to_canva (module Layer.Paths.ReprFixed) (p, p) context `Line
+ Layer.Paths.to_canva (module Path.Fixed) (p, path.Outline.back) context `Line
)
| Selection (Point (id, point)) ->
(* As before, mark the selected path *)
@@ -265,22 +268,22 @@ let on_change canva mouse_position timer state =
List.iter
state.paths
- ~f:(fun path ->
- if id = path.Outline.id then
+ ~f:(fun outline ->
+ if id = outline.Outline.id then
let path = begin match pos with
| Some pos ->
let pos_v2 = Gg.V2.of_tuple pos in
if Elements.Timer.delay timer < 0.3 then
- path.Outline.path
+ outline.Outline.path
else
let point' = Path.Point.copy point pos_v2 in
- begin match Path.Fixed.replace_point path.Outline.path point' with
- | None -> path.Outline.path
+ begin match Path.Fixed.replace_point outline.Outline.path point' with
+ | None -> outline.Outline.path
| Some p -> p
end
- | None -> path.Outline.path end in
- Layer.Paths.to_canva (module Layer.Paths.ReprFixed) (path, path) context `Line
+ | None -> outline.Outline.path end in
+ Layer.Paths.to_canva (module Path.Fixed) (path, outline.Outline.back) context `Line
);
(* Now draw the selected point *)