Clean up face selection code
parent
adb2768154
commit
aee47a42c6
|
@ -185,7 +185,7 @@ void GraphicsWindow::MakeSelected(Selection *stog) {
|
|||
|
||||
if(stog->entity.v != 0 && SK.GetEntity(stog->entity)->IsFace()) {
|
||||
// In the interest of speed for the triangle drawing code,
|
||||
// only three faces may be selected at a time.
|
||||
// only MAX_SELECTABLE_FACES faces may be selected at a time.
|
||||
int c = 0;
|
||||
Selection *s;
|
||||
selection.ClearTags();
|
||||
|
@ -193,9 +193,9 @@ void GraphicsWindow::MakeSelected(Selection *stog) {
|
|||
hEntity he = s->entity;
|
||||
if(he.v != 0 && SK.GetEntity(he)->IsFace()) {
|
||||
c++;
|
||||
// Modify also Group::DrawMesh "case DrawMeshAs::SELECTED:"
|
||||
// Magic numers are ugly :-(
|
||||
if(c >= 3) s->tag = 1;
|
||||
// See also GraphicsWindow::GroupSelection "if(e->IsFace())"
|
||||
// and Group::DrawMesh "case DrawMeshAs::SELECTED:"
|
||||
if(c >= MAX_SELECTABLE_FACES) s->tag = 1;
|
||||
}
|
||||
}
|
||||
selection.RemoveTagged();
|
||||
|
|
|
@ -635,11 +635,11 @@ void Group::DrawMesh(DrawMeshAs how, Canvas *canvas) {
|
|||
std::vector<uint32_t> faces;
|
||||
SS.GW.GroupSelection();
|
||||
auto const &gs = SS.GW.gs;
|
||||
// Modify also GraphicsWindow::MakeSelected "if(c >= 3) s->tag = 1;"
|
||||
// Magic numers are ugly :-(
|
||||
if(gs.faces > 0) faces.push_back(gs.face[0].v);
|
||||
if(gs.faces > 1) faces.push_back(gs.face[1].v);
|
||||
if(gs.faces > 2) faces.push_back(gs.face[2].v);
|
||||
// See also GraphicsWindow::MakeSelected "if(c >= MAX_SELECTABLE_FACES)"
|
||||
// and GraphicsWindow::GroupSelection "if(e->IsFace())"
|
||||
for(auto &fc : gs.face) {
|
||||
faces.push_back(fc.v);
|
||||
}
|
||||
canvas->DrawFaces(displayMesh, faces, hcf);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue