fix slow_down_layers (#5396)

Setting slow_down_layers to 2 or more results in wrong number of slowed
down layers.

Do not increment layer_id since bottom layer (#0) handled separately.
This commit is contained in:
Dima Buzdyk 2024-05-24 17:00:09 +05:00 committed by GitHub
parent 1d5fb94dd1
commit 966c18cbad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5195,7 +5195,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
speed = m_config.get_abs_value("initial_layer_speed");
}
else if(m_config.slow_down_layers > 1){
const auto _layer = layer_id() + 1;
const auto _layer = layer_id();
if (_layer > 0 && _layer < m_config.slow_down_layers) {
const auto first_layer_speed =
is_perimeter(path.role())