diff --git a/src/geometry/MixedLinesSet.cpp b/src/geometry/MixedLinesSet.cpp index c080becf41..8b0d4a5455 100644 --- a/src/geometry/MixedLinesSet.cpp +++ b/src/geometry/MixedLinesSet.cpp @@ -42,16 +42,17 @@ Shape MixedLinesSet::offset(coord_t distance, ClipperLib::JoinType join_type, do } else { - static auto end_type_fn = [&line, &join_type]() + ClipperLib::EndType end_type; + + if (line->hasClosingSegment()) + { + end_type = ClipperLib::etClosedLine; + } + else { - if (line->hasClosingSegment()) - { - return ClipperLib::etClosedLine; - } - return join_type == ClipperLib::jtMiter ? ClipperLib::etOpenSquare : ClipperLib::etOpenRound; - }; - - const ClipperLib::EndType end_type{ end_type_fn() }; + end_type = (join_type == ClipperLib::jtMiter) ? ClipperLib::etOpenSquare : ClipperLib::etOpenRound; + } + clipper.AddPath(line->getPoints(), join_type, end_type); } }