diff --git a/src/draw.cpp b/src/draw.cpp index af760ef..fa056c1 100644 --- a/src/draw.cpp +++ b/src/draw.cpp @@ -506,7 +506,7 @@ void GraphicsWindow::Paint(void) { // At the same depth, we want later lines drawn over earlier. glDepthFunc(GL_LEQUAL); - if(SS.AllGroupsOkay()) { + if(SS.ActiveGroupsOkay()) { glClearColor(SS.backgroundColor.redF(), SS.backgroundColor.greenF(), SS.backgroundColor.blueF(), 1.0f); diff --git a/src/generate.cpp b/src/generate.cpp index 4e248b5..18a84ca 100644 --- a/src/generate.cpp +++ b/src/generate.cpp @@ -506,10 +506,13 @@ void SolveSpaceUI::SolveGroup(hGroup hg, bool andFindFree) { FreeAllTemporary(); } -bool SolveSpaceUI::AllGroupsOkay() { +bool SolveSpaceUI::ActiveGroupsOkay() { for(int i = 0; i < SK.group.n; i++) { - if(!SK.group.elem[i].IsSolvedOkay()) + Group *group = &SK.group.elem[i]; + if(!group->IsSolvedOkay()) return false; + if(group->h.v == SS.GW.activeGroup.v) + break; } return true; } diff --git a/src/solvespace.h b/src/solvespace.h index 8aceaa6..ae6b216 100644 --- a/src/solvespace.h +++ b/src/solvespace.h @@ -874,7 +874,7 @@ public: void MarkDraggedParams(void); void ForceReferences(void); - bool AllGroupsOkay(void); + bool ActiveGroupsOkay(void); // The system to be solved. System sys; diff --git a/src/textscreens.cpp b/src/textscreens.cpp index 07c28fd..0caf6c1 100644 --- a/src/textscreens.cpp +++ b/src/textscreens.cpp @@ -552,7 +552,7 @@ void TextWindow::ScreenStepDimGo(int link, uint32_t v) { c->valA = start + ((finish - start)*i)/n; SS.MarkGroupDirty(c->group); SS.GenerateAll(); - if(!SS.AllGroupsOkay()) { + if(!SS.ActiveGroupsOkay()) { // Failed to solve, so quit break; }