aboutsummaryrefslogtreecommitdiff
path: root/layer/paths.ml
diff options
context:
space:
mode:
Diffstat (limited to 'layer/paths.ml')
-rwxr-xr-xlayer/paths.ml23
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