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

pull/4/head
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.
if(g.IsMeshGroup() && SK.groupOrder.n > 0) {
Group *running = SK.GetRunningMeshGroup();
Group *running = SK.GetRunningMeshGroupFor(SS.GW.activeGroup);
if(running != NULL) {
g.color = running->color;
}

View File

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

View File

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