From 9a1e85c1f4ffcbd0f0e9a54c6ee63c35646e7564 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Thu, 4 May 2023 13:29:04 +0200 Subject: [PATCH] Conflict checker: sort detected conflicts to show the one with lowest z in the notification --- src/libslic3r/GCode/ConflictChecker.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libslic3r/GCode/ConflictChecker.cpp b/src/libslic3r/GCode/ConflictChecker.cpp index 2030399f5..f7841601e 100644 --- a/src/libslic3r/GCode/ConflictChecker.cpp +++ b/src/libslic3r/GCode/ConflictChecker.cpp @@ -249,6 +249,10 @@ ConflictResultOpt ConflictChecker::find_inter_of_lines_in_diff_objs(PrintObjectP }); if (find) { + std::sort(conflict.begin(), conflict.end(), [](const std::pair& i1, const std::pair& i2) { + return i1.second < i2.second; + }); + const void *ptr1 = conflictQueue.idToObjsPtr(conflict[0].first._obj1); const void *ptr2 = conflictQueue.idToObjsPtr(conflict[0].first._obj2); double conflictHeight = conflict[0].second;