Mesh: Clear loose edges bitmap with count of zero

When there are no loose edges, the loose edge bitmap shouldn't be used.
That was already documented in the loose edge storage struct, but the
bit vector wasn't actually cleared.
This commit is contained in:
2023-02-27 13:09:45 -05:00
parent 52104c1a0c
commit f37077ae5a

View File

@@ -124,7 +124,9 @@ const blender::bke::LooseEdgeCache &Mesh::loose_edges() const
count--;
}
}
if (count == 0) {
loose_edges.clear_and_shrink();
}
r_data.count = count;
});
@@ -135,7 +137,7 @@ void Mesh::loose_edges_tag_none() const
{
using namespace blender::bke;
this->runtime->loose_edges_cache.ensure([&](LooseEdgeCache &r_data) {
r_data.is_loose_bits.resize(0);
r_data.is_loose_bits.clear_and_shrink();
r_data.count = 0;
});
}