From 288faff717161150ca7a20aca04deaa19794134f Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 7 Mar 2024 11:45:00 +0100 Subject: [PATCH] Minor code styling fix CURA-9838 --- src/SkirtBrim.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/SkirtBrim.cpp b/src/SkirtBrim.cpp index 24363718b1..013df7e339 100644 --- a/src/SkirtBrim.cpp +++ b/src/SkirtBrim.cpp @@ -222,13 +222,17 @@ coord_t SkirtBrim::generateOffset(const Offset& offset, Polygons& covered_area, if (std::holds_alternative(offset.reference_outline_or_index_)) { Polygons* reference_outline = std::get(offset.reference_outline_or_index_); + const coord_t offset_value = offset.offset_value_; for (ConstPolygonRef polygon : *reference_outline) { - const coord_t offset_value = offset.offset_value_; const double area = polygon.area(); - if ((area > 0 && offset.outside_) || (area < 0 && offset.inside_)) + if (area > 0 && offset.outside_) { - brim.add(polygon.offset(area < 0 ? -offset_value : offset_value, ClipperLib::jtRound)); + brim.add(polygon.offset(offset_value, ClipperLib::jtRound)); + } + else if (area < 0 && offset.inside_) + { + brim.add(polygon.offset(-offset_value, ClipperLib::jtRound)); } } }