Fix the "Show degrees of freedom" command.

Before this commit, it never highlighted anything at all.
It was broken when chord tolerance calculation was overhauled.
This commit is contained in:
EvilSpirit 2016-06-27 21:25:41 +06:00 committed by whitequark
parent 561b2797e8
commit 51f3d7e438
2 changed files with 6 additions and 2 deletions

View File

@ -11,6 +11,7 @@ Bug fixes:
* Do not remove autosaves after successfully opening a file, preventing
data loss in case of two abnormal terminations in a row.
* Do not crash when changing autosave interval.
* Unbreak the "Show degrees of freedom" command.
* Three.js: correctly respond to controls when browser zoom is used.
* OS X: do not completely hide main window when defocused.

View File

@ -205,7 +205,7 @@ void SolveSpaceUI::GenerateAll(GenerateType type, bool andFindFree, bool genForB
// If we're generating entities for display, first we need to find
// the bounding box to turn relative chord tolerance to absolute.
if(!SS.exportMode && !genForBBox) {
GenerateAll(type, /*andFindFree=*/false, /*genForBBox=*/true);
GenerateAll(type, andFindFree, /*genForBBox=*/true);
BBox box = SK.CalculateEntityBBox(/*includeInvisibles=*/true);
Vector size = box.maxp.Minus(box.minp);
double maxSize = std::max({ size.x, size.y, size.z });
@ -293,7 +293,10 @@ void SolveSpaceUI::GenerateAll(GenerateType type, bool andFindFree, bool genForB
if(newp->known) continue;
Param *prevp = prev.FindByIdNoOops(newp->h);
if(prevp) newp->val = prevp->val;
if(prevp) {
newp->val = prevp->val;
newp->free = prevp->free;
}
}
if(g->h.v == Group::HGROUP_REFERENCES.v) {