Don't reset showFaces every time a group is activated
Instead store the state separately for drawing and non-drawing group types, and set showFaces to one of those, whenever a group is activated.pull/1090/head
parent
1b8e1dec65
commit
56719415de
|
@ -407,6 +407,8 @@ void GraphicsWindow::Init() {
|
|||
showEdges = true;
|
||||
showMesh = false;
|
||||
showOutlines = false;
|
||||
showFacesDrawing = false;
|
||||
showFacesNonDrawing = true;
|
||||
drawOccludedAs = DrawOccludedAs::INVISIBLE;
|
||||
|
||||
showTextWindow = true;
|
||||
|
@ -1366,6 +1368,14 @@ void GraphicsWindow::ToggleBool(bool *v) {
|
|||
SS.GenerateAll(SolveSpaceUI::Generate::UNTIL_ACTIVE);
|
||||
}
|
||||
|
||||
if(v == &showFaces) {
|
||||
if(g->type == Group::Type::DRAWING_WORKPLANE || g->type == Group::Type::DRAWING_3D) {
|
||||
showFacesDrawing = showFaces;
|
||||
} else {
|
||||
showFacesNonDrawing = showFaces;
|
||||
}
|
||||
}
|
||||
|
||||
Invalidate(/*clearPersistent=*/true);
|
||||
SS.ScheduleShowTW();
|
||||
}
|
||||
|
|
|
@ -416,11 +416,10 @@ std::string Group::DescriptionString() {
|
|||
}
|
||||
|
||||
void Group::Activate() {
|
||||
if(type == Type::EXTRUDE || type == Type::LINKED || type == Type::LATHE ||
|
||||
type == Type::REVOLVE || type == Type::HELIX || type == Type::TRANSLATE || type == Type::ROTATE) {
|
||||
SS.GW.showFaces = true;
|
||||
if(type == Type::DRAWING_WORKPLANE || type == Type::DRAWING_3D) {
|
||||
SS.GW.showFaces = SS.GW.showFacesDrawing;
|
||||
} else {
|
||||
SS.GW.showFaces = false;
|
||||
SS.GW.showFaces = SS.GW.showFacesNonDrawing;
|
||||
}
|
||||
SS.MarkGroupDirty(h); // for good measure; shouldn't be needed
|
||||
SS.ScheduleShowTW();
|
||||
|
|
Loading…
Reference in New Issue