Skip to content

Commit

Permalink
fixed #172, to test
Browse files Browse the repository at this point in the history
  • Loading branch information
rbossy committed Nov 6, 2023
1 parent 1849bdb commit 8d18003
Showing 1 changed file with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,16 +325,27 @@ public Layer overlapping(int from, int to) {
List<Annotation> list;
if (hasOverlaps()) {
list = new ArrayList<Annotation>();
for (Annotation annot : annotations.subList(0, fromi))
if (annot.getEnd() > from)
for (Annotation annot : annotations.subList(0, fromi)) {
if (annot.getEnd() > from) {
list.add(annot);
for (Annotation annot : annotations.subList(fromi, toi))
list.add(annot);
}
}
if (toi > fromi) {
for (Annotation annot : annotations.subList(fromi, toi - 1)) {
list.add(annot);
}
}
}
else {
if ((fromi > 0) && (annotations.get(fromi - 1).getEnd() > from))
if ((fromi > 0) && (annotations.get(fromi - 1).getEnd() > from)) {
fromi--;
list = annotations.subList(fromi, toi);
}
if (toi > fromi) {
list = annotations.subList(fromi, toi - 1);
}
else {
list = Collections.emptyList();
}
}
return subLayer(list);
}
Expand Down

0 comments on commit 8d18003

Please sign in to comment.