From dbb40095b7970533e83d64e968abf5b61f51c25d Mon Sep 17 00:00:00 2001
From: Alessandro Ranellucci <aar@cpan.org>
Date: Sun, 12 Feb 2012 23:44:24 +0100
Subject: [PATCH] Bugfix: fatal error when offsetting a surface results in more
 than one expolygon. #201

---
 lib/Slic3r/Surface.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/Slic3r/Surface.pm b/lib/Slic3r/Surface.pm
index 95a97d7cc..238229bd0 100644
--- a/lib/Slic3r/Surface.pm
+++ b/lib/Slic3r/Surface.pm
@@ -39,10 +39,10 @@ sub group {
 
 sub offset {
     my $self = shift;
-    return (ref $self)->new(
-        expolygon => $self->expolygon->offset_ex(@_),
+    return map (ref $self)->new(
+        expolygon => $_,
         map { $_ => $self->$_ } qw(surface_type depth_layers bridge_angle),
-    );
+    ), $self->expolygon->offset_ex(@_);
 }
 
 sub add_hole {