diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2021-02-05 09:08:39 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@dailly.me> | 2022-02-07 14:39:30 +0100 |
commit | 561d0f0155f4906d90eb7e73a3ff9cb28909126f (patch) | |
tree | 9a606c2d7832272ea33d7052512a5fa59805d582 /layer/svg.ml | |
parent | 86ec559f913c389e8dc055b494630f21a45e039b (diff) |
Update project structure
Diffstat (limited to 'layer/svg.ml')
-rwxr-xr-x | layer/svg.ml | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/layer/svg.ml b/layer/svg.ml deleted file mode 100755 index 2394cb8..0000000 --- a/layer/svg.ml +++ /dev/null @@ -1,64 +0,0 @@ -(** SVG representation *) - -open Brr - -module V2 = Gg.V2 - -let svg : El.cons - = fun ?d ?at childs -> - El.v ?d ?at (Jstr.v "svg") childs - -let path: El.cons - = fun ?d ?at childs -> - El.v ?d ?at (Jstr.v "path") childs - -type t = Jstr.t - -let create - : unit -> t - = fun () -> Jstr.empty - -(* Start a new path. *) -let move_to - : Gg.v2 -> t -> t - = fun point path -> - let x, y = V2.to_tuple point in - - Jstr.concat ~sep:(Jstr.v " ") - [ path - ; Jstr.v "M" - ; Jstr.of_float x - ; Jstr.of_float y ] - -let line_to - : Gg.v2 -> t -> t - = fun point path -> - let x, y = V2.to_tuple point in - Jstr.concat ~sep:(Jstr.v " ") - [ path - ; (Jstr.v "L") - ; (Jstr.of_float x) - ; (Jstr.of_float y) ] - -let quadratic_to - : Gg.v2 -> Gg.v2 -> Gg.v2 -> t -> t - = fun ctrl0 ctrl1 p1 path -> - let cx, cy = V2.to_tuple ctrl0 - and cx', cy' = V2.to_tuple ctrl1 - and x, y = V2.to_tuple p1 in - Jstr.concat ~sep:(Jstr.v " ") - [ path - ; (Jstr.v "C") - ; (Jstr.of_float cx) - ; (Jstr.of_float cy) - ; (Jstr.v ",") - ; (Jstr.of_float cx') - ; (Jstr.of_float cy') - ; (Jstr.v ",") - ; (Jstr.of_float x) - ; (Jstr.of_float y) ] - -let close - : t -> t - = fun path -> - Jstr.append path (Jstr.v " Z") |