So that we preserve backcompat as much as possible.
$set->clip(
LaTeX::TikZ::Set::Polyline->new(
points => [ $ua, @outside, $ub ],
- cycle => 1,
+ closed => 1,
),
);
},
coerce => 1,
);
+=head2 C<closed>
+
+A boolean that indicates whether the polyline is closed or not.
+
+=cut
+
+has 'closed' => (
+ is => 'ro',
+ isa => 'Bool',
+ required => 1,
+ default => 0,
+);
+
sub points { @{$_[0]->_kids} }
around 'BUILDARGS' => sub {
my ($orig, $class, %args) = @_;
+ delete $args{cycle};
+
$class->$orig(
%args,
connector => '--',
+ cycle => $args{closed},
);
};
polyline => sub {
shift;
- __PACKAGE__->new(points => \@_);
+ __PACKAGE__->new(
+ points => \@_,
+ closed => 0,
+ );
},
closed_polyline => sub {
shift;
__PACKAGE__->new(
points => \@_,
- cycle => 1
+ closed => 1,
);
},
);