From 86a828afd2b2b6ab8fe8b79a4b20edc2ad74bd88 Mon Sep 17 00:00:00 2001 From: "songwei.li" Date: Wed, 30 Jul 2025 10:08:45 +0800 Subject: [PATCH] FIX: Incorrect flush matrix update condition judgment Due to the decimal portion of floating-point numbers generated during square root extraction, mismatched matrix sizes were mistakenly considered consistent, resulting in the flush matrix size not being corrected. Now we compare the square value to avoid errors. jira: STUDIO-13727 Change-Id: I1f3768dab186b25c9ac4e85d4eff24913f15b3dc (cherry picked from commit d0e9a8c3f3086b4ad2bc14bbfebd3d6ceff9eefc) --- src/libslic3r/PresetBundle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index 937cd34ad4..d5d9860478 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -3898,7 +3898,7 @@ void PresetBundle::update_multi_material_filament_presets(size_t to_delete_filam f_multiplier.resize(nozzle_nums, 1.f); } - if (num_filaments != old_number_of_filaments) { + if ( (num_filaments * num_filaments) != size_t(old_matrix.size() / old_nozzle_nums) ) { // First verify if purging volumes presets for each extruder matches number of extruders std::vector& filaments = this->project_config.option("flush_volumes_vector")->values; while (filaments.size() < 2* num_filaments) {