FIX: fix color painting bugs

1. fix a crash when loading a 3mf painting with color idx larger than 15
2. fix the facets not display issue if painted with color 15

Signed-off-by: yifan.wu <yifan.wu@bambulab.com>
Change-Id: Idb53b6bb2d3665412815222ab9a1d47948afed56
This commit is contained in:
yifan.wu 2022-08-17 17:08:17 +08:00 committed by Lane.Wei
parent ad311a66d6
commit 4f44ca4117
3 changed files with 6 additions and 7 deletions

View file

@ -1427,7 +1427,7 @@ void TriangleSelector::get_facets(std::vector<indexed_triangle_set>& facets_per_
{
facets_per_type.clear();
for (int type = (int)EnforcerBlockerType::NONE; type < (int)EnforcerBlockerType::Extruder15; type++) {
for (int type = (int)EnforcerBlockerType::NONE; type <= (int)EnforcerBlockerType::ExtruderMax; type++) {
facets_per_type.emplace_back();
indexed_triangle_set& its = facets_per_type.back();
std::vector<int> vertex_map(m_vertices.size(), -1);