When choosing color for a new group, consider active, not last, group.

This commit is contained in:
whitequark 2016-04-10 11:25:26 +00:00
parent 98e0a30a98
commit 2d25bdb51f
3 changed files with 4 additions and 5 deletions

View File

@ -225,7 +225,7 @@ void Group::MenuGroup(int id) {
// Copy color from the previous mesh-contributing group. // Copy color from the previous mesh-contributing group.
if(g.IsMeshGroup() && SK.groupOrder.n > 0) { if(g.IsMeshGroup() && SK.groupOrder.n > 0) {
Group *running = SK.GetRunningMeshGroup(); Group *running = SK.GetRunningMeshGroupFor(SS.GW.activeGroup);
if(running != NULL) { if(running != NULL) {
g.color = running->color; g.color = running->color;
} }

View File

@ -853,9 +853,8 @@ BBox Sketch::CalculateEntityBBox(bool includingInvisible) {
return box; return box;
} }
Group *Sketch::GetRunningMeshGroup() { Group *Sketch::GetRunningMeshGroupFor(hGroup h) {
if(groupOrder.n < 1) return NULL; Group *g = GetGroup(h);
Group *g = GetGroup(groupOrder.elem[groupOrder.n - 1]);
while(g != NULL) { while(g != NULL) {
if(g->IsMeshGroup()) { if(g->IsMeshGroup()) {
return g; return g;

View File

@ -670,7 +670,7 @@ public:
void Clear(void); void Clear(void);
BBox CalculateEntityBBox(bool includingInvisible); BBox CalculateEntityBBox(bool includingInvisible);
Group *GetRunningMeshGroup(); Group *GetRunningMeshGroupFor(hGroup h);
}; };
#undef ENTITY #undef ENTITY
#undef CONSTRAINT #undef CONSTRAINT