opengles emulator: fix a bug in RangeList

When an intersection is found, we want to add it to the output list, if splitting is needed and if not.

Change-Id: I9c9827b1c0ecd434925ff5698dd42bc1025dbedf
This commit is contained in:
Stas Gurtovoy
2011-08-03 09:08:08 +03:00
committed by David 'Digit' Turner
parent ded8587d2d
commit 0957f4acda

View File

@@ -86,17 +86,17 @@ void RangeList::delRange(const Range& r,RangeList& deleted) {
erase(i);
i--;
if (intersection!=old) { // otherwise split:
//intersection on right side
if(old.getStart() != intersection.getStart()) {
list.insert(list.begin(),Range(old.getStart(),intersection.getStart() - old.getStart()));
}
//intersection on left side
if(old.getEnd() != intersection.getEnd()) {
list.insert(list.begin(),Range(intersection.getEnd(),old.getEnd() - intersection.getEnd()));
}
deleted.addRange(intersection);
//intersection on right side
if(old.getStart() != intersection.getStart()) {
list.insert(list.begin(),Range(old.getStart(),intersection.getStart() - old.getStart()));
}
//intersection on left side
if(old.getEnd() != intersection.getEnd()) {
list.insert(list.begin(),Range(intersection.getEnd(),old.getEnd() - intersection.getEnd()));
}
}
deleted.addRange(intersection);
}
}
}