From ea52fcbce15363405fc8b1c649f52f6e8a357180 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 12 Oct 2016 23:15:15 +0000 Subject: [PATCH] Remove unnecessary GenerateAll/ZoomToFit calls in AfterNewFile. These were useful before because chord tolerance depended on the zoom level; and so the first generation produced a crude mesh used to set the zoom level, and the second actually did useful work. Chord tolerance is now independent of the zoom level, so this code is no longer useful. --- src/solvespace.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/solvespace.cpp b/src/solvespace.cpp index 8861854a..587ccaae 100644 --- a/src/solvespace.cpp +++ b/src/solvespace.cpp @@ -317,7 +317,7 @@ void SolveSpaceUI::AfterNewFile() { SS.GW.projRight = Vector::From(1, 0, 0); SS.GW.projUp = Vector::From(0, 1, 0); - GenerateAll(Generate::REGEN); + GenerateAll(Generate::ALL); TW.Init(); GW.Init(); @@ -329,15 +329,6 @@ void SolveSpaceUI::AfterNewFile() { GW.width = w; GW.height = h; - // The triangles haven't been generated yet, but zoom to fit the entities - // roughly in the window, since that sets the mesh tolerance. Consider - // invisible entities, so we still get something reasonable if the only - // thing visible is the not-yet-generated surfaces. - GW.ZoomToFit(/*includingInvisibles=*/true); - - GenerateAll(Generate::ALL); - SS.ScheduleShowTW(); - // Then zoom to fit again, to fit the triangles GW.ZoomToFit(/*includingInvisibles=*/false); // Create all the default styles; they'll get created on the fly anyways,