);
has 'origin' => (
- is => 'ro',
- does => 'Maybe[LaTeX::TikZ::Point]',
+ is => 'ro',
+ isa => 'Maybe[LaTeX::TikZ::Point::Autocoerce]',
+ coerce => 1,
);
+sub id {
+ my $tikz = shift;
+
+ join $;, map {
+ my $val = $tikz->$_;
+ defined($val) ? "$val" : '(undef)';
+ } qw/unit format scale width height origin/;
+}
+
my $find_mods;
$find_mods = do {
no warnings 'recursion';
my $h = $tikz->height;
my $canvas = '';
if (defined $w and defined $h) {
- $seq->clip(Tikz->rectangle(Tikz->point(0) => [ $w, $h ]));
+ require LaTeX::TikZ::Set::Rectangle;
+ $seq->clip(LaTeX::TikZ::Set::Rectangle->new(
+ from => 0,
+ width => $w,
+ height => $h,
+ ));
$_ = $tikz->len($_) for $w, $h;
$canvas = ",papersize={$w,$h},body={$w,$h}";
}
0.8 * $width * ($tikz->scale / 5);
}
+use LaTeX::TikZ::Interface formatter => sub {
+ shift;
+
+ __PACKAGE__->new(@_);
+};
+
__PACKAGE__->meta->make_immutable;
=head1 AUTHOR