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.
pull/19/head
EvilSpirit 2016-06-27 21:25:41 +06:00 committed by whitequark
parent da1fc3fd70
commit 32a2a4dbd9
2 changed files with 6 additions and 2 deletions

View File

@ -18,6 +18,7 @@ Bug fixes:
* Do not remove autosaves after successfully opening a file, preventing * Do not remove autosaves after successfully opening a file, preventing
data loss in case of two abnormal terminations in a row. data loss in case of two abnormal terminations in a row.
* Do not crash when changing autosave interval. * 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. * Three.js: correctly respond to controls when browser zoom is used.
* OS X: do not completely hide main window when defocused. * OS X: do not completely hide main window when defocused.
* GTK: unbreak 3Dconnexion support. * GTK: unbreak 3Dconnexion support.

View File

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