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   48 use parent 'Khonsu::Shape';
  5         22  
  5         54  
4              
5             sub shape {
6 2     2 0 16 my ($self, $file, $shape, %args) = @_;
7 2         11 $shape->strokecolor($args{fill_colour});
8 2         380 $shape->move($args{x}, $file->page->h - ($args{y} + 1));
9 2 50       275 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         14 $shape->linejoin();
17 2         147 $shape->line($args{ex}, $file->page->h - ($args{ey} + 1));
18 2         221 $shape->stroke;
19             }
20              
21             1;