Commit 1c0d6629 authored by Thorsten Wißmann's avatar Thorsten Wißmann 🐧
Browse files

Fix "missing conflict" bug

parent adce69c8
......@@ -34,11 +34,6 @@ $ elm repl
axes are placed at a certain ratio of the track (which is actually better but
not really possible for the animation).
* No conflict is detected for two cars with the resp. motions:
xxx0 -> xx
xxx1 -> x
* Add a favicon:
<link rel="shortcut icon" href="/lib/tpl/mnml-blog/user/favicon.png">
......@@ -347,11 +347,17 @@ carriageOnInterval p1 p2 car =
(upper `List.prefix_of` p) && (p `List.prefix_of` lower)
Moving m ->
let
-- tells wether path p is on the track when going down from u to l
is_on : RT.Path -> (RT.Path,RT.Path) -> Bool
is_on p (u,l) = ((u `List.prefix_of` p) && (p `List.prefix_of` l))
x1 = m.upper_point
x2 = m.upper_point ++ List.map fst m.delta
in
((upper `List.prefix_of` x1) && (x1 `List.prefix_of` lower))
||
((upper `List.prefix_of` x2) && (x2 `List.prefix_of` lower))
-- we have an intersection of the tracks (upper,lower) and (x1,x2)
-- if any of the endpoints lies on the other track
(upper `is_on` (x1,x2))
|| (lower `is_on` (x1,x2))
|| (x1 `is_on` (upper,lower))
|| (x2 `is_on` (upper,lower))
-- vim: ft=elm et ts=2 sw=2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment