File Coverage

blib/lib/Khonsu/Shape/Line.pm
Criterion Covered Total %
statement 10 14 71.4
branch 3 6 50.0
condition n/a
subroutine 2 2 100.0
pod 0 1 0.0
total 15 23 65.2


line stmt bran cond sub pod time code
1             package Khonsu::Shape::Line;
2              
3 5     5   46 use parent 'Khonsu::Shape';
  5         14  
  5         52  
4              
5             sub shape {
6 2     2 0 10 my ($self, $file, $shape, %args) = @_;
7 2         24 $shape->strokecolor($args{fill_colour});
8 2         318 $shape->move($args{x}, $file->page->h - ($args{y} + 1));
9 2 50       245 if ($args{dash}) {
    50          
    50          
10 0         0 $shape->linedash(@{$args{dash}});
  0         0  
11             } elsif ($args{type} eq 'dots') {
12 0         0 $shape->linedash(1, 1);
13             } elsif ($args{type} eq 'dashed') {
14 0         0 $shape->linedash(5, 5);
15             }
16 2         16 $shape->linejoin();
17 2         139 $shape->line($args{ex}, $file->page->h - ($args{ey} + 1));
18 2         206 $shape->stroke;
19             }
20              
21             1;