So that we preserve backcompat as much as possible.
$set->clip(
LaTeX::TikZ::Set::Polyline->new(
points => [ $ua, @outside, $ub ],
$set->clip(
LaTeX::TikZ::Set::Polyline->new(
points => [ $ua, @outside, $ub ],
+=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) = @_;
sub points { @{$_[0]->_kids} }
around 'BUILDARGS' => sub {
my ($orig, $class, %args) = @_;
$class->$orig(
%args,
connector => '--',
$class->$orig(
%args,
connector => '--',
+ cycle => $args{closed},
- __PACKAGE__->new(points => \@_);
+ __PACKAGE__->new(
+ points => \@_,
+ closed => 0,
+ );
},
closed_polyline => sub {
shift;
__PACKAGE__->new(
points => \@_,
},
closed_polyline => sub {
shift;
__PACKAGE__->new(
points => \@_,