FIX:backup iterator location

Jira: STUDIO-5267
Change-Id: Id035c9225a858bb551aa4f09870fc4c6bb30b255
This commit is contained in:
zhou.xu 2023-12-07 16:01:05 +08:00 committed by Lane.Wei
parent 80e4f34219
commit 955d62fdf1

View File

@ -2231,6 +2231,7 @@ static void triangulate_slice(
[&v](const std::pair<Vec2f, int> &l) {
return l.first.x() < v.x() || (is_equal_for_sort(l.first.x(), v.x()) && l.first.y() < v.y());
});
auto back_it = it;
int idx = -1;
bool exist = false;
for (auto iter = section_vertices_map.begin(); iter != section_vertices_map.end(); iter++) {
@ -2252,6 +2253,7 @@ static void triangulate_slice(
}
// go on finding
if (!exist) {
it = back_it;
for (; it != map_vertex_to_index.begin(); it--) {
if (is_equal(it->first.x(), v.x()) && is_equal(it->first.y(), v.y())) {
idx = it->second;