diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index 847352aaa4..59e4c73949 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -173,7 +173,7 @@ void FffGcodeWriter::writeGCode(SliceDataStorage& storage, TimeKeeper& time_keep { if (extruder_is_used_in_filler_layers) { - process_layer_starting_layer_nr = -Raft::getFillerLayerCount(); + process_layer_starting_layer_nr = -static_cast(Raft::getFillerLayerCount()); break; } } @@ -2860,7 +2860,7 @@ size_t FffGcodeWriter::findUsedExtruderIndex(const SliceDataStorage& storage, co { return last ? extruder_use.back().extruder_nr : extruder_use.front().extruder_nr; } - else if (layer_nr <= -Raft::getTotalExtraLayers()) + else if (layer_nr <= -LayerIndex(Raft::getTotalExtraLayers())) { // Asking for extruder use below first layer, give first extruder return getStartExtruder(storage); diff --git a/src/PrimeTower.cpp b/src/PrimeTower.cpp index bc4e2a07a7..3b7933235f 100644 --- a/src/PrimeTower.cpp +++ b/src/PrimeTower.cpp @@ -604,7 +604,7 @@ const Shape& PrimeTower::getOuterPoly(const LayerIndex& layer_nr) const const Shape& PrimeTower::getGroundPoly() const { - return getOuterPoly(-Raft::getTotalExtraLayers()); + return getOuterPoly(-LayerIndex(Raft::getTotalExtraLayers())); } void PrimeTower::gotoStartLocation(LayerPlan& gcode_layer, const int extruder_nr) const diff --git a/src/PrimeTower/PrimeTower.cpp b/src/PrimeTower/PrimeTower.cpp index 074d1f501a..30b8ab7eb7 100644 --- a/src/PrimeTower/PrimeTower.cpp +++ b/src/PrimeTower/PrimeTower.cpp @@ -351,7 +351,7 @@ bool PrimeTower::extruderRequiresPrime(const std::vector& extruder_is_used void PrimeTower::gotoStartLocation(LayerPlan& gcode_layer, const size_t extruder_nr) const { LayerIndex layer_nr = gcode_layer.getLayerNr(); - if (layer_nr != -Raft::getTotalExtraLayers()) + if (layer_nr != -LayerIndex(Raft::getTotalExtraLayers())) { coord_t wipe_radius; auto iterator = base_occupied_outline_.iterator_at(gcode_layer.getLayerNr()); diff --git a/src/raft.cpp b/src/raft.cpp index edaff83509..f4d40eb8f0 100644 --- a/src/raft.cpp +++ b/src/raft.cpp @@ -199,26 +199,23 @@ Raft::LayerType Raft::getLayerType(LayerIndex layer_index) const auto interface_layers = Raft::getInterfaceLayers(); const auto surface_layers = Raft::getSurfaceLayers(); - if (layer_index < -airgap - surface_layers - interface_layers) + if (layer_index < -LayerIndex(airgap + surface_layers + interface_layers)) { return LayerType::RaftBase; } - else if (layer_index < -airgap - surface_layers) + if (layer_index < -LayerIndex(airgap + surface_layers)) { return LayerType::RaftInterface; } - else if (layer_index < -airgap) + if (layer_index < -LayerIndex(airgap)) { return LayerType::RaftSurface; } - else if (layer_index < 0) + if (layer_index < LayerIndex(0)) { return LayerType::Airgap; } - else - { - return LayerType::Model; - } + return LayerType::Model; } size_t Raft::getLayersAmount(const std::string& extruder_nr_setting_name, const std::string& target_raft_section)