From 32a2a4dbd9fb67bddc86d49d91e52d393753ef67 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 414d966a..d0541ae9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,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. * GTK: unbreak 3Dconnexion support. diff --git a/src/generate.cpp b/src/generate.cpp index 8ab40c27..541ba173 100644 --- a/src/generate.cpp +++ b/src/generate.cpp @@ -203,7 +203,7 @@ void SolveSpaceUI::GenerateAll(Generate type, bool andFindFree, bool genForBBox) // 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 }); @@ -250,7 +250,10 @@ void SolveSpaceUI::GenerateAll(Generate type, bool andFindFree, bool genForBBox) 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) {