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;
|
showEdges = true;
|
||||||
showMesh = false;
|
showMesh = false;
|
||||||
showOutlines = false;
|
showOutlines = false;
|
||||||
|
showFacesDrawing = false;
|
||||||
|
showFacesNonDrawing = true;
|
||||||
drawOccludedAs = DrawOccludedAs::INVISIBLE;
|
drawOccludedAs = DrawOccludedAs::INVISIBLE;
|
||||||
|
|
||||||
showTextWindow = true;
|
showTextWindow = true;
|
||||||
|
@ -1366,6 +1368,14 @@ void GraphicsWindow::ToggleBool(bool *v) {
|
||||||
SS.GenerateAll(SolveSpaceUI::Generate::UNTIL_ACTIVE);
|
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);
|
Invalidate(/*clearPersistent=*/true);
|
||||||
SS.ScheduleShowTW();
|
SS.ScheduleShowTW();
|
||||||
}
|
}
|
||||||
|
|
|
@ -416,11 +416,10 @@ std::string Group::DescriptionString() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Group::Activate() {
|
void Group::Activate() {
|
||||||
if(type == Type::EXTRUDE || type == Type::LINKED || type == Type::LATHE ||
|
if(type == Type::DRAWING_WORKPLANE || type == Type::DRAWING_3D) {
|
||||||
type == Type::REVOLVE || type == Type::HELIX || type == Type::TRANSLATE || type == Type::ROTATE) {
|
SS.GW.showFaces = SS.GW.showFacesDrawing;
|
||||||
SS.GW.showFaces = true;
|
|
||||||
} else {
|
} else {
|
||||||
SS.GW.showFaces = false;
|
SS.GW.showFaces = SS.GW.showFacesNonDrawing;
|
||||||
}
|
}
|
||||||
SS.MarkGroupDirty(h); // for good measure; shouldn't be needed
|
SS.MarkGroupDirty(h); // for good measure; shouldn't be needed
|
||||||
SS.ScheduleShowTW();
|
SS.ScheduleShowTW();
|
||||||
|
|
Loading…
Reference in New Issue