From 267907e5bac9e134184d0d62654d6bc3698aeeae Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Thu, 8 Oct 2020 10:00:39 +0200 Subject: [PATCH] SLA: Fix for crash with only 1 layer fixes #4836 --- src/libslic3r/SLAPrintSteps.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/SLAPrintSteps.cpp b/src/libslic3r/SLAPrintSteps.cpp index d94bc682b..11c8c6f4e 100644 --- a/src/libslic3r/SLAPrintSteps.cpp +++ b/src/libslic3r/SLAPrintSteps.cpp @@ -93,9 +93,10 @@ void SLAPrint::Steps::apply_printer_corrections(SLAPrintObject &po, SliceOrigin coord_t clpr_offs = scaled(doffs); faded_lyrs = std::min(po.m_slice_index.size(), faded_lyrs); + size_t faded_lyrs_efc = std::max(size_t(1), faded_lyrs - 1); - auto efc = [start_efc, faded_lyrs](size_t pos) { - return (faded_lyrs - 1 - pos) * start_efc / (faded_lyrs - 1); + auto efc = [start_efc, faded_lyrs_efc](size_t pos) { + return (faded_lyrs_efc - pos) * start_efc / faded_lyrs_efc; }; std::vector &slices = o == soModel ?