Skip to content

Commit e30e540

Browse files
vouillonOlivierNicole
authored andcommitted
Fix hyperbolic tree example
1 parent b38e20d commit e30e540

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

examples/hyperbolic/hypertree.ml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -590,13 +590,13 @@ let arc c (rx, ry, dx, dy) z0 z1 z2 =
590590
c##beginPath;
591591
let alpha = mod_float (fin -. start +. (2. *. pi)) (2. *. pi) in
592592
c##ellipse
593-
((z0.x *. rx) +. dx)
594-
((z0.y *. ry) +. dy)
595-
(rd *. rx)
596-
(rd *. ry)
597-
0.
598-
start
599-
fin
593+
(Js.float ((z0.x *. rx) +. dx))
594+
(Js.float ((z0.y *. ry) +. dy))
595+
(Js.float (rd *. rx))
596+
(Js.float (rd *. ry))
597+
(Js.float 0.)
598+
(Js.float start)
599+
(Js.float fin)
600600
(Js.bool (alpha > pi));
601601
c##stroke
602602

@@ -645,7 +645,15 @@ let draw canvas vertices edges nodes boxes =
645645
(Js.float (float canvas##.height));
646646
let padding = Js.to_float (opt_style style##.padding (Js.float 0.)) in
647647
c##beginPath;
648-
c##ellipse dx dy (rx +. padding) (ry +. padding) 0. 0. 7. Js._false;
648+
c##ellipse
649+
(Js.float dx)
650+
(Js.float dy)
651+
(Js.float (rx +. padding))
652+
(Js.float (ry +. padding))
653+
(Js.float 0.)
654+
(Js.float 0.)
655+
(Js.float 7.)
656+
Js._false;
649657
Js.Optdef.iter style##.backgroundColor (fun color ->
650658
c##.fillStyle := color;
651659
c##fill);

0 commit comments

Comments
 (0)