aboutsummaryrefslogtreecommitdiff
path: root/path/fixed.ml
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2021-01-05 21:43:08 +0100
committerSébastien Dailly <sebastien@chimrod.com>2021-01-05 21:43:08 +0100
commit6ae97ecca8b4f38213f0f45aa6eaef944cd6b497 (patch)
tree4161c43168fa02f89f4fcf352142d4646d0e980a /path/fixed.ml
parenta8f37f041dce3f16917b6659d3ca97492f178f4d (diff)
Responsive sliders
Diffstat (limited to 'path/fixed.ml')
-rwxr-xr-xpath/fixed.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/path/fixed.ml b/path/fixed.ml
index d20c897..7ee0705 100755
--- a/path/fixed.ml
+++ b/path/fixed.ml
@@ -141,7 +141,7 @@ module Make(Point:P) = struct
(** Return the distance between a given point and the curve. May return
None if the point is out of the curve *)
let distance
- : Gg.v2 -> t -> (Gg.v2 * float) option
+ : Gg.v2 -> t -> (Gg.v2 * float * Point.t * Point.t) option
= fun point beziers ->
Array.fold_left beziers.path
@@ -171,8 +171,8 @@ module Make(Point:P) = struct
let _, point' = Shapes.Bezier.get_closest_point point bezier' in
let distance = Gg.V2.( norm (point - point') ) in
match res with
- | None -> Some (point', distance)
- | Some (_, d) -> if d < distance then res else (Some (point', distance))
+ | None -> Some (point', distance, bezier.p0, bezier.p1)
+ | Some (_, d, _, _) -> if d < distance then res else (Some (point', distance, bezier.p0, bezier.p1))
end
)