| 1 | #! perl | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use v5.26; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use Object::Pad; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use Storable; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | class SVGPDF::Use :isa(SVGPDF::Element); | ||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 5 | ▶ | method process () { | ||||||||||||||||||||||||||
|
Subroutine
process: called CC=6 SCAR=19.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | 5 | my $atts = $self->atts; | |||||||||||||||||||||||||||
| 13 | 5 | my $xo = $self->xo; | |||||||||||||||||||||||||||
| 14 | 5 | ▶ | return if $atts->{omit}; # for testing/debugging. | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 5 | my ( $x, $y, $hr, $tf ) = | |||||||||||||||||||||||||||
| 17 | $self->get_params( $atts, qw( x:H y:V href:! transform:s ) ); | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 5 | my $r = $self->root->defs->{$hr}; | |||||||||||||||||||||||||||
| 20 | 5 | ▶ | unless ( $r ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | 0 | warn("SVG: Missing def for use \"$hr\" (skipped)\n"); | |||||||||||||||||||||||||||
| 22 | 0 | $self->css_pop; | |||||||||||||||||||||||||||
| 23 | 0 | return; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | # Update its xo. | ||||||||||||||||||||||||||||
| 27 | 5 | $r->xo = $self->xo; | |||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 5 | $self->_dbg( $self->name, " \"$hr\" (", $r->name, "), x=$x, y=$y" ); | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 5 | $self->_dbg("+ xo save"); | |||||||||||||||||||||||||||
| 32 | 5 | $xo->save; | |||||||||||||||||||||||||||
| 33 | 5 | ▶ | if ( $x || $y ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$x or $y
MC/DC0%0/2
$x or $y
$x
$y
Truth table33%1/3
A or B
A= $xB= $y
| |||||||||||||||||||||||||||||
| 34 | 0 | $self->_dbg( "translate( %.2f %.2f )", $x, $y ); | |||||||||||||||||||||||||||
| 35 | 0 | $xo->transform( translate => [ $x, $y ] ); | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | 5 | ▶ | $self->set_transform($tf) if $tf; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | 5 | $self->set_graphics; | |||||||||||||||||||||||||||
| 39 | 5 | $r->process; | |||||||||||||||||||||||||||
| 40 | 5 | $self->_dbg("- xo restore"); | |||||||||||||||||||||||||||
| 41 | 5 | $xo->restore; | |||||||||||||||||||||||||||
| 42 | 5 | $self->css_pop; | |||||||||||||||||||||||||||
| 43 | 2 | } | |||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 2 | 1; | |||||||||||||||||||||||||||