| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package LaTeX::TikZ::Mod::Pattern::Dots; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
7003
|
use strict; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
74
|
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
84
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
LaTeX::TikZ::Mod::Pattern::Dots - A dotted pattern modifier. |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 VERSION |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Version 0.03 |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
|
17
|
|
|
|
|
|
|
|
|
18
|
2
|
|
|
2
|
|
10
|
use Sub::Name (); |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
33
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
9
|
use Mouse; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
15
|
|
|
21
|
2
|
|
|
2
|
|
768
|
use Mouse::Util::TypeConstraints; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
215
|
|
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 RELATIONSHIPS |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
This class inherits the L class and its L, L, L and L methods. |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=cut |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
extends 'LaTeX::TikZ::Mod::Pattern'; |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 C |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
has 'dot_width' => ( |
|
38
|
|
|
|
|
|
|
is => 'ro', |
|
39
|
|
|
|
|
|
|
isa => subtype('Num' => where { LaTeX::TikZ::Tools::numcmp($_, 0) >= 0 }), |
|
40
|
|
|
|
|
|
|
default => 1, |
|
41
|
|
|
|
|
|
|
); |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 C |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
has 'space_width' => ( |
|
48
|
|
|
|
|
|
|
is => 'ro', |
|
49
|
|
|
|
|
|
|
isa => subtype('Num' => where { LaTeX::TikZ::Tools::numcmp($_, 0) >= 0 }), |
|
50
|
|
|
|
|
|
|
default => 10, |
|
51
|
|
|
|
|
|
|
); |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $W = Sub::Name::subname('WIDTH' => sub { sprintf '#WIDTH=%0.1f#', @_ }); |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
my $forge_template = Sub::Name::subname('forge_template' => sub { |
|
56
|
|
|
|
|
|
|
my ($dot_width, $space_width) = @_; |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
my ($low_left, $up_right, $tile_size, $center); |
|
59
|
|
|
|
|
|
|
my ($width, $half_width, $shadow_min, $shadow_max); |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
$width = $W->($space_width); |
|
62
|
|
|
|
|
|
|
$half_width = $W->($space_width / 2); |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
$shadow_min = $W->(- $dot_width); |
|
65
|
|
|
|
|
|
|
$shadow_max = $W->($space_width + $dot_width); |
|
66
|
|
|
|
|
|
|
$dot_width = $W->($dot_width); |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
$low_left = "\\pgfqpoint{$shadow_min}{$shadow_min}"; |
|
69
|
|
|
|
|
|
|
$up_right = "\\pgfqpoint{$shadow_max}{$shadow_max}"; |
|
70
|
|
|
|
|
|
|
$center = "\\pgfqpoint{$half_width}{$half_width}"; |
|
71
|
|
|
|
|
|
|
$tile_size = "\\pgfqpoint{$width}{$width}"; |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
return [ |
|
74
|
|
|
|
|
|
|
"\\pgfdeclarepatternformonly{#NAME#}{$low_left}{$up_right}{$tile_size}{", |
|
75
|
|
|
|
|
|
|
"\\pgfpathcircle{$center}{$dot_width}", |
|
76
|
|
|
|
|
|
|
"\\pgfusepath{fill}", |
|
77
|
|
|
|
|
|
|
'}', |
|
78
|
|
|
|
|
|
|
]; |
|
79
|
|
|
|
|
|
|
}); |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
around 'BUILDARGS' => sub { |
|
82
|
|
|
|
|
|
|
my ($orig, $class, %args) = @_; |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
confess('Can\'t specify an explicit template for a '. __PACKAGE__ .' pattern') |
|
85
|
|
|
|
|
|
|
if exists $args{template}; |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
my @params = qw; |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
my $meta = $class->meta; |
|
90
|
|
|
|
|
|
|
for (@params) { |
|
91
|
|
|
|
|
|
|
my $attr = $meta->find_attribute_by_name($_); |
|
92
|
|
|
|
|
|
|
$args{$_} = $attr->default if $attr->has_default and not exists $args{$_}; |
|
93
|
|
|
|
|
|
|
$attr->type_constraint->assert_valid($args{$_}); |
|
94
|
|
|
|
|
|
|
} |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
$args{template} = $forge_template->(@args{@params}); |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
$class->$orig(%args); |
|
99
|
|
|
|
|
|
|
}; |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
L, L. |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 AUTHOR |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Vincent Pit, C<< >>, L. |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
You can contact me by mail or on C (vincent). |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 BUGS |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through the web interface at L. |
|
116
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 SUPPORT |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
perldoc LaTeX::TikZ |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Copyright 2010,2011,2012,2013,2014,2015 Vincent Pit, all rights reserved. |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=cut |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
1; # End of LaTeX::TikZ::Mod::Pattern::Dots |