File Coverage

blib/lib/SVGPDF/Line.pm
Criterion Covered Total %
statement 29 29 100.0
branch 2 4 50.0
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 36 39 92.3


line stmt bran cond sub pod time code
1             #! perl
2              
3 2     2   891 use v5.26;
  2         6  
4 2     2   8 use Object::Pad;
  2         3  
  2         10  
5 2     2   167 use utf8;
  2         2  
  2         9  
6 2     2   35 use Carp;
  2         3  
  2         353  
7              
8             class SVGPDF::Line :isa(SVGPDF::Element);
9              
10 5     5 0 6 method process () {
  5         9  
  5         5  
11 5         14 my $atts = $self->atts;
12 5         12 my $xo = $self->xo;
13 5 50       13 return if $atts->{omit}; # for testing/debugging.
14              
15 5         14 my ( $x1, $y1, $x2, $y2, $tf ) =
16             $self->get_params( $atts, qw( x1:H y1:V x2:H y2:V transform:s ) );
17              
18 5         13 $self->_dbg( $self->name, " x1=$x1 y1=$y1 x2=$x2 y2=$y2" );
19 5         18 $self->_dbg( "+ xo save" );
20 5         21 $xo->save;
21              
22 5         193 $self->set_graphics;
23 5 50       13 $self->set_transform($tf) if $tf;
24              
25 5         20 $xo->move( $x1, $y1 );
26 5         358 $xo->line( $x2, $y2 );
27 5         297 $self->_paintsub->();
28              
29 5         182 $self->_dbg( "- xo restore" );
30 5         15 $xo->restore;
31 5         153 $self->css_pop;
32             }
33              
34              
35             1;