diff --git a/src/libslic3r/GCode/CoolingBuffer.cpp b/src/libslic3r/GCode/CoolingBuffer.cpp index b574c95b37..41655a754d 100644 --- a/src/libslic3r/GCode/CoolingBuffer.cpp +++ b/src/libslic3r/GCode/CoolingBuffer.cpp @@ -783,8 +783,8 @@ std::string CoolingBuffer::apply_layer_cooldown( if (int(layer_id) >= disable_fan_first_layers && int(layer_id) + 1 < full_fan_speed_layer) { // Ramp up the fan speed from disable_fan_first_layers to full_fan_speed_layer. float factor = float(int(layer_id + 1) - disable_fan_first_layers) / float(full_fan_speed_layer - disable_fan_first_layers); - fan_speed_new = std::clamp(int(float(fan_speed_new) * factor + 0.5f), 0, 255); - bridge_fan_speed = std::clamp(int(float(bridge_fan_speed) * factor + 0.5f), 0, 255); + fan_speed_new = std::clamp(int(float(fan_speed_new) * factor + 0.5f), 0, 100); + bridge_fan_speed = std::clamp(int(float(bridge_fan_speed) * factor + 0.5f), 0, 100); custom_fan_speed_limits.second = fan_speed_new; } #undef EXTRUDER_CONFIG diff --git a/src/libslic3r/GCode/ToolOrdering.cpp b/src/libslic3r/GCode/ToolOrdering.cpp index acddb137e5..acc3bf2050 100644 --- a/src/libslic3r/GCode/ToolOrdering.cpp +++ b/src/libslic3r/GCode/ToolOrdering.cpp @@ -470,20 +470,16 @@ void ToolOrdering::fill_wipe_tower_partitions(const PrintConfig &config, coordf_ bool ToolOrdering::insert_wipe_tower_extruder() { // In case that wipe_tower_extruder is set to non-zero, we must make sure that the extruder will be in the list. + // The list is 1-based, as is the config value ! bool changed = false; if (m_print_config_ptr->wipe_tower_extruder != 0) { for (LayerTools& lt : m_layer_tools) { if (lt.wipe_tower_partitions > 0) { - lt.extruders.emplace_back(m_print_config_ptr->wipe_tower_extruder - 1); + lt.extruders.emplace_back(m_print_config_ptr->wipe_tower_extruder); sort_remove_duplicates(lt.extruders); changed = true; } } - // Now convert the 0-based list to 1-based again. - for (LayerTools& lt : m_layer_tools) { - for (auto& extruder : lt.extruders) - ++extruder; - } } return changed; } diff --git a/src/slic3r/GUI/GUI_ObjectLayers.cpp b/src/slic3r/GUI/GUI_ObjectLayers.cpp index 6f6ec52380..4727c6d30b 100644 --- a/src/slic3r/GUI/GUI_ObjectLayers.cpp +++ b/src/slic3r/GUI/GUI_ObjectLayers.cpp @@ -283,7 +283,7 @@ void ObjectLayers::sys_color_changed() if (item->IsSizer()) {// case when we have editor with buttons for (size_t btn : {2, 3}) { // del_btn, add_btn wxSizerItem* b_item = item->GetSizer()->GetItem(btn); - if (b_item->IsWindow()) { + if (b_item && b_item->IsWindow()) { auto button = dynamic_cast(b_item->GetWindow()); if (button != nullptr) button->sys_color_changed();