From 51f3d7e43856c576185d64b5565fe8d91b6fac94 Mon Sep 17 00:00:00 2001 From: EvilSpirit Date: Mon, 27 Jun 2016 21:25:41 +0600 Subject: [PATCH] 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. --- CHANGELOG.md | 1 + src/generate.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69c4095..1ce481e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/src/generate.cpp b/src/generate.cpp index 0931d7d..2784098 100644 --- a/src/generate.cpp +++ b/src/generate.cpp @@ -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) {