From: Vincent Pit Date: Sun, 1 Aug 2010 21:56:50 +0000 (+0200) Subject: Bump the default space width of patterns to 10 X-Git-Tag: v0.02~8 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;ds=inline;h=d8d667d1c5266bff861df78c252c92d1504be92c;p=perl%2Fmodules%2FLaTeX-TikZ.git Bump the default space width of patterns to 10 --- diff --git a/lib/LaTeX/TikZ.pm b/lib/LaTeX/TikZ.pm index 02d9b67..c425f29 100644 --- a/lib/LaTeX/TikZ.pm +++ b/lib/LaTeX/TikZ.pm @@ -36,7 +36,7 @@ our $VERSION = '0.01'; $octo->clip(Tikz->rectangle(-0.5*(1+i), 2*(1+i))); # Fill it with dots - $octo->mod(Tikz->pattern(class => 'Dots', space_width => 10)); + $octo->mod(Tikz->pattern(class => 'Dots')); # Create a formatter object my $tikz = Tikz->formatter(scale => 5); diff --git a/lib/LaTeX/TikZ/Mod/Pattern/Dots.pm b/lib/LaTeX/TikZ/Mod/Pattern/Dots.pm index 1e3bfaa..3698a2f 100644 --- a/lib/LaTeX/TikZ/Mod/Pattern/Dots.pm +++ b/lib/LaTeX/TikZ/Mod/Pattern/Dots.pm @@ -47,7 +47,7 @@ has 'dot_width' => ( has 'space_width' => ( is => 'ro', isa => subtype('Num' => where { LaTeX::TikZ::Tools::numcmp($_, 0) >= 0 }), - default => 1, + default => 10, ); my $W = Sub::Name::subname('WIDTH' => sub { sprintf '#WIDTH=%0.1f#', @_ }); diff --git a/lib/LaTeX/TikZ/Mod/Pattern/Lines.pm b/lib/LaTeX/TikZ/Mod/Pattern/Lines.pm index d495ffd..10a63f4 100644 --- a/lib/LaTeX/TikZ/Mod/Pattern/Lines.pm +++ b/lib/LaTeX/TikZ/Mod/Pattern/Lines.pm @@ -63,7 +63,7 @@ has 'line_width' => ( has 'space_width' => ( is => 'ro', isa => subtype('Num' => where { LaTeX::TikZ::Tools::numcmp($_, 0) >= 0 }), - default => 1, + default => 10, ); my $W = Sub::Name::subname('WIDTH' => sub { sprintf '#WIDTH=%0.1f#', @_ }); diff --git a/samples/synopsis.pl b/samples/synopsis.pl index c5ab5fd..41c2295 100644 --- a/samples/synopsis.pl +++ b/samples/synopsis.pl @@ -24,7 +24,7 @@ my $octo = Tikz->closed_polyline( $octo->clip(Tikz->rectangle(-0.5*(1+i), 2*(1+i))); # Fill it with dots -$octo->mod(Tikz->pattern(class => 'Dots', space_width => 10)); +$octo->mod(Tikz->pattern(class => 'Dots')); # Create a formatter object my $tikz = Tikz->formatter(scale => 5); diff --git a/t/23-pattern.t b/t/23-pattern.t index 5f69bd0..c592ad0 100644 --- a/t/23-pattern.t +++ b/t/23-pattern.t @@ -44,10 +44,10 @@ my $lines = eval { is $@, '', 'creating a line pattern doesn\'t croak'; check $lines, 'a line pattern', <<'DECL', <<'BODY'; -\pgfdeclarepatternformonly{pata}{\pgfqpoint{-0.2pt}{-0.2pt}}{\pgfqpoint{0.3pt}{0.3pt}}{\pgfqpoint{0.2pt}{0.2pt}}{ +\pgfdeclarepatternformonly{pata}{\pgfqpoint{-0.2pt}{-0.2pt}}{\pgfqpoint{1.8pt}{1.8pt}}{\pgfqpoint{1.6pt}{1.6pt}}{ \pgfsetlinewidth{0.2pt} -\pgfpathmoveto{\pgfqpoint{-0.2pt}{0.1pt}} -\pgfpathlineto{\pgfqpoint{0.3pt}{0.1pt}} +\pgfpathmoveto{\pgfqpoint{-0.2pt}{0.8pt}} +\pgfpathlineto{\pgfqpoint{1.8pt}{0.8pt}} \pgfusepath{stroke} } DECL @@ -61,8 +61,8 @@ my $dots = eval { is $@, '', 'creating a dot pattern doesn\'t croak'; check $dots, 'a dot pattern', <<'DECL', <<'BODY'; -\pgfdeclarepatternformonly{patb}{\pgfqpoint{-0.2pt}{-0.2pt}}{\pgfqpoint{0.3pt}{0.3pt}}{\pgfqpoint{0.2pt}{0.2pt}}{ -\pgfpathcircle{\pgfqpoint{0.1pt}{0.1pt}}{0.2pt} +\pgfdeclarepatternformonly{patb}{\pgfqpoint{-0.2pt}{-0.2pt}}{\pgfqpoint{1.8pt}{1.8pt}}{\pgfqpoint{1.6pt}{1.6pt}}{ +\pgfpathcircle{\pgfqpoint{0.8pt}{0.8pt}}{0.2pt} \pgfusepath{fill} } DECL @@ -81,10 +81,10 @@ my $seq = eval { is $@, '', 'creating a sequence with two identic patterns doesn\'t croak'; check $seq, 'a sequence with two identic patterns', <<'DECL', <<'BODY'; -\pgfdeclarepatternformonly{pata}{\pgfqpoint{-0.2pt}{-0.2pt}}{\pgfqpoint{0.3pt}{0.3pt}}{\pgfqpoint{0.2pt}{0.2pt}}{ +\pgfdeclarepatternformonly{pata}{\pgfqpoint{-0.2pt}{-0.2pt}}{\pgfqpoint{1.8pt}{1.8pt}}{\pgfqpoint{1.6pt}{1.6pt}}{ \pgfsetlinewidth{0.2pt} -\pgfpathmoveto{\pgfqpoint{-0.2pt}{0.1pt}} -\pgfpathlineto{\pgfqpoint{0.3pt}{0.1pt}} +\pgfpathmoveto{\pgfqpoint{-0.2pt}{0.8pt}} +\pgfpathlineto{\pgfqpoint{1.8pt}{0.8pt}} \pgfusepath{stroke} } DECL @@ -101,16 +101,16 @@ is $@, '', 'creating a sequence with two orthogonal line patterns doesn\'t croak'; check $seq, 'a sequence with two orthogonal line patterns', <<'DECL', <<'BODY'; -\pgfdeclarepatternformonly{patc}{\pgfqpoint{-0.2pt}{-0.2pt}}{\pgfqpoint{0.3pt}{0.3pt}}{\pgfqpoint{0.2pt}{0.2pt}}{ +\pgfdeclarepatternformonly{patc}{\pgfqpoint{-0.2pt}{-0.2pt}}{\pgfqpoint{1.8pt}{1.8pt}}{\pgfqpoint{1.6pt}{1.6pt}}{ \pgfsetlinewidth{0.2pt} -\pgfpathmoveto{\pgfqpoint{0.1pt}{-0.2pt}} -\pgfpathlineto{\pgfqpoint{0.1pt}{0.3pt}} +\pgfpathmoveto{\pgfqpoint{0.8pt}{-0.2pt}} +\pgfpathlineto{\pgfqpoint{0.8pt}{1.8pt}} \pgfusepath{stroke} } -\pgfdeclarepatternformonly{pata}{\pgfqpoint{-0.2pt}{-0.2pt}}{\pgfqpoint{0.3pt}{0.3pt}}{\pgfqpoint{0.2pt}{0.2pt}}{ +\pgfdeclarepatternformonly{pata}{\pgfqpoint{-0.2pt}{-0.2pt}}{\pgfqpoint{1.8pt}{1.8pt}}{\pgfqpoint{1.6pt}{1.6pt}}{ \pgfsetlinewidth{0.2pt} -\pgfpathmoveto{\pgfqpoint{-0.2pt}{0.1pt}} -\pgfpathlineto{\pgfqpoint{0.3pt}{0.1pt}} +\pgfpathmoveto{\pgfqpoint{-0.2pt}{0.8pt}} +\pgfpathlineto{\pgfqpoint{1.8pt}{0.8pt}} \pgfusepath{stroke} } DECL @@ -126,14 +126,14 @@ $seq = eval { is $@, '', 'creating a sequence with two different patterns doesn\'t croak'; check $seq, 'a sequence with two different patterns', <<'DECL', <<'BODY'; -\pgfdeclarepatternformonly{patb}{\pgfqpoint{-0.2pt}{-0.2pt}}{\pgfqpoint{0.3pt}{0.3pt}}{\pgfqpoint{0.2pt}{0.2pt}}{ -\pgfpathcircle{\pgfqpoint{0.1pt}{0.1pt}}{0.2pt} +\pgfdeclarepatternformonly{patb}{\pgfqpoint{-0.2pt}{-0.2pt}}{\pgfqpoint{1.8pt}{1.8pt}}{\pgfqpoint{1.6pt}{1.6pt}}{ +\pgfpathcircle{\pgfqpoint{0.8pt}{0.8pt}}{0.2pt} \pgfusepath{fill} } -\pgfdeclarepatternformonly{pata}{\pgfqpoint{-0.2pt}{-0.2pt}}{\pgfqpoint{0.3pt}{0.3pt}}{\pgfqpoint{0.2pt}{0.2pt}}{ +\pgfdeclarepatternformonly{pata}{\pgfqpoint{-0.2pt}{-0.2pt}}{\pgfqpoint{1.8pt}{1.8pt}}{\pgfqpoint{1.6pt}{1.6pt}}{ \pgfsetlinewidth{0.2pt} -\pgfpathmoveto{\pgfqpoint{-0.2pt}{0.1pt}} -\pgfpathlineto{\pgfqpoint{0.3pt}{0.1pt}} +\pgfpathmoveto{\pgfqpoint{-0.2pt}{0.8pt}} +\pgfpathlineto{\pgfqpoint{1.8pt}{0.8pt}} \pgfusepath{stroke} } DECL