Skip to content

Commit

Permalink
fix flood print selected facets
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoireHENRY committed Apr 20, 2024
1 parent 3b26da1 commit c2914a8
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/simu/routines/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,21 +859,28 @@ pub fn update_surf_selected_faces(
let v = &mut bodies[ii_body].surface.faces[face].vertex;
v.color_mode = ColorMode::Color;
v.color = config.window.color_selection;

println!(
"Selected faces: {:?}\n",
selected.iter().map(|f| f.index).collect_vec()
);
} else {
let selected = selected.remove(selected.iter().position(|f| f.index == face).unwrap());
let selected_face =
selected.remove(selected.iter().position(|f| f.index == face).unwrap());
let v = &mut bodies[ii_body].surface.faces[face].vertex;
v.color_mode = selected.mode;
match selected.mode {
ColorMode::Color => v.color = selected.color,
v.color_mode = selected_face.mode;
match selected_face.mode {
ColorMode::Color => v.color = selected_face.color,
_ => {}
};

println!(
"Selected faces: {:?}\n",
selected.iter().map(|f| f.index).collect_vec()
);
}
}
let s = &mut bodies[ii_body].surface;
s.apply_facedata_to_vertices();
// win.update_vao(ii_body, s);
println!(
"Selected faces: {:?}\n",
selected.iter().map(|f| f.index).collect_vec()
);
}

0 comments on commit c2914a8

Please sign in to comment.