Fix bug in overlap check

This commit is contained in:
Ng Zhi An 2018-12-16 11:30:50 -08:00
parent 408a3b99d8
commit 3403f8d75b
1 changed files with 2 additions and 1 deletions

View File

@ -20,9 +20,10 @@ applyFix fix fileLines =
if overlap x y then x:(removeOverlap ys) else x:y:(removeOverlap ys) if overlap x y then x:(removeOverlap ys) else x:y:(removeOverlap ys)
-- two position overlaps when -- two position overlaps when
overlap x y = overlap x y =
(yStart >= xStart && yStart <= xEnd) || (yStart < xStart && yStart > xStart) (yStart >= xStart && yStart < xEnd) || (yStart < xStart && yEnd > xStart)
where where
yStart = repStartPos y yStart = repStartPos y
yEnd = repEndPos y
xStart = repStartPos x xStart = repStartPos x
xEnd = repEndPos x xEnd = repEndPos x