diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2021-01-06 22:09:53 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2021-01-06 22:09:53 +0100 |
commit | a63662059215a26db627c4b76147a3c9338f5b74 (patch) | |
tree | c71b984b2327ebe743809e04b0a29aac0e15cc56 /layer/paths.ml | |
parent | 6ae97ecca8b4f38213f0f45aa6eaef944cd6b497 (diff) |
Point suppression
Diffstat (limited to 'layer/paths.ml')
-rwxr-xr-x | layer/paths.ml | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/layer/paths.ml b/layer/paths.ml index 3cedd6d..59215df 100755 --- a/layer/paths.ml +++ b/layer/paths.ml @@ -11,13 +11,14 @@ end (* Canva representation *) module FillCanvaRepr = FillPrinter.Make(CanvaPrinter) +module DuctusCanvaRepr = DuctusPrinter.Make(CanvaPrinter) module LineCanvaRepr = LinePrinter.Make(CanvaPrinter) module WireCanvaRepr = WireFramePrinter.Make(CanvaPrinter) (* SVG representation *) module FillSVGRepr = FillPrinter.Make(Svg) -module LineSVGRepr = LinePrinter.Make(Svg) +module DuctusSVGRepr = DuctusPrinter.Make(Svg) module WireSVGRepr = WireFramePrinter.Make(Svg) @@ -47,9 +48,9 @@ let to_canva | `Ductus -> R.repr path - (module WireCanvaRepr) - (WireCanvaRepr.create_path (fun p -> Brr_canvas.C2d.fill ctx p; p)) - |> WireCanvaRepr.get + (module DuctusCanvaRepr) + (DuctusCanvaRepr.create_path (fun p -> Brr_canvas.C2d.fill ctx p; p)) + |> DuctusCanvaRepr.get |> Brr_canvas.C2d.stroke ctx @@ -81,18 +82,6 @@ let to_svg ; v (Jstr.v "stroke") color] !paths - | `Line -> - let svg_path = R.repr - path - (module LineSVGRepr) - (LineSVGRepr.create_path (fun _ -> ())) - |> LineSVGRepr.get in - Svg.path - ~at:Brr.At.[ - v (Jstr.v "fill") color - ; v (Jstr.v "stroke") color - ; v (Jstr.v "d") svg_path ] - [] | `Ductus -> let svg_path = R.repr path @@ -105,3 +94,5 @@ let to_svg ; v (Jstr.v "stroke") color ; v (Jstr.v "d") svg_path ] [] + | `Line -> + raise Not_found |