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   1124 use v5.26;
  2         7  
4 2     2   11 use Object::Pad;
  2         4  
  2         16  
5 2     2   283 use utf8;
  2         3  
  2         14  
6 2     2   58 use Carp;
  2         4  
  2         539  
7              
8             class SVGPDF::Line :isa(SVGPDF::Element);
9              
10 5     5 0 11 method process () {
  5         18  
  5         10  
11 5         24 my $atts = $self->atts;
12 5         19 my $xo = $self->xo;
13 5 50       19 return if $atts->{omit}; # for testing/debugging.
14              
15 5         53 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         26 $self->_dbg( $self->name, " x1=$x1 y1=$y1 x2=$x2 y2=$y2" );
19 5         32 $self->_dbg( "+ xo save" );
20 5         44 $xo->save;
21              
22 5         341 $self->set_graphics;
23 5 50       19 $self->set_transform($tf) if $tf;
24              
25 5         28 $xo->move( $x1, $y1 );
26 5         620 $xo->line( $x2, $y2 );
27 5         502 $self->_paintsub->();
28              
29 5         296 $self->_dbg( "- xo restore" );
30 5         28 $xo->restore;
31 5         314 $self->css_pop;
32             }
33              
34              
35             1;