on master help sign in
fix interval overlap detection
commitf2fc60cfade79b92c8cd40a33d83b3bb107cd74d authorAgentM <agentm@themactionfaction.com> dateThu 10 Aug 2017, 16:26 (9 years ago) parent9f743ca
1 file changed+2−2
src/lib/ProjectM36/DataTypes/Interval.hs+2−2
src/lib/ProjectM36/DataTypes/Interval.hs+2−2
@@ -96,8 +96,8 @@ intervalOverlaps :: Atom -> Atom -> Either AtomFunctionError Bool
9696intervalOverlaps (IntervalAtom i1start i1end i1startopen i1endopen) (IntervalAtom i2start i2end i2startopen i2endopen) = do
9797 cmp1 <- atomCompare i1start i2end
9898 cmp2 <- atomCompare i2start i1end
99− let startcmp = if i1startopen then oplt else oplte
100− endcmp = if i2startopen then oplt else oplte
99+ let startcmp = if i1startopen || i2endopen then oplt else oplte
100+ endcmp = if i2startopen || i1endopen then oplt else oplte
101101 oplte op = op == LT || op == EQ
102102 oplt op = op == LT
103103 pure (startcmp cmp1 && endcmp cmp2)