From d585f0d1ff32d385f3ef26fdca8ea801212e742a Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 22 Mar 2015 16:23:40 +0300 Subject: [PATCH] Make "Align view onto workplane" switch to locked workplane, if any. Original patch by yugami (http://solvespace.com/forum.pl?action=viewthread&parent=508). --- src/graphicswin.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/graphicswin.cpp b/src/graphicswin.cpp index 83a54c86..60e1f7c7 100644 --- a/src/graphicswin.cpp +++ b/src/graphicswin.cpp @@ -446,15 +446,12 @@ void GraphicsWindow::MenuView(int id) { break; case MNU_ONTO_WORKPLANE: - if(!SS.GW.LockedInWorkplane()) { - Error("No workplane is active."); + if(SS.GW.LockedInWorkplane()) { + SS.GW.AnimateOntoWorkplane(); + SS.GW.ClearSuper(); + SS.ScheduleShowTW(); break; - } - SS.GW.AnimateOntoWorkplane(); - SS.GW.ClearSuper(); - SS.ScheduleShowTW(); - break; - + } // if not in 2d mode fall through and use ORTHO logic case MNU_NEAREST_ORTHO: case MNU_NEAREST_ISO: { static const Vector ortho[3] = { @@ -480,7 +477,7 @@ void GraphicsWindow::MenuView(int id) { Vector on = ou.Cross(ov); Vector u, v; - if(id == MNU_NEAREST_ORTHO) { + if(id == MNU_NEAREST_ORTHO || id == MNU_ONTO_WORKPLANE) { u = ou; v = ov; } else {