Revert "Simplify Group::IsVisible(), GroupsInOrder()."

This reverts commit 022d012a44.

The commit above has caused crashes during pruning.
This commit is contained in:
whitequark 2017-01-16 11:48:56 +00:00
parent 8370382a33
commit 67146f6ab2
2 changed files with 10 additions and 4 deletions

View File

@ -57,8 +57,15 @@ bool SolveSpaceUI::PruneOrphans() {
bool SolveSpaceUI::GroupsInOrder(hGroup before, hGroup after) {
if(before.v == 0) return true;
if(after.v == 0) return true;
int beforep = SK.GetGroup(before)->order;
int afterp = SK.GetGroup(after)->order;
int beforep = -1, afterp = -1;
int i;
for(i = 0; i < SK.groupOrder.n; i++) {
hGroup hg = SK.groupOrder.elem[i];
if(hg.v == before.v) beforep = i;
if(hg.v == after.v) afterp = i;
}
if(beforep < 0 || afterp < 0) return false;
if(beforep >= afterp) return false;
return true;
}

View File

@ -44,8 +44,7 @@ void Group::AddParam(IdList<Param,hParam> *param, hParam hp, double v) {
bool Group::IsVisible() {
if(!visible) return false;
Group *active = SK.GetGroup(SS.GW.activeGroup);
if(order > active->order) return false;
if(SS.GroupsInOrder(SS.GW.activeGroup, h)) return false;
return true;
}