Fix for #8156 - Automatic color change for logo crashes PrusaSlicer with second object of 0.2mm height

This commit is contained in:
YuSanka 2022-04-04 11:42:10 +02:00
parent 6a5443dad2
commit 8a8d2d15b0

View File

@ -2096,7 +2096,8 @@ void Control::auto_color_change()
const Print& print = GUI::wxGetApp().plater()->fff_print(); const Print& print = GUI::wxGetApp().plater()->fff_print();
for (auto object : print.objects()) { for (auto object : print.objects()) {
if (object->layer_count() == 0) // An object should to have at least 2 layers to apply an auto color change
if (object->layer_count() < 2)
continue; continue;
check_color_change(object, 1, object->layers().size(), false, [this, extruders_cnt](Layer* layer) check_color_change(object, 1, object->layers().size(), false, [this, extruders_cnt](Layer* layer)