File Coverage

blib/lib/Khonsu/Page/Footer.pm
Criterion Covered Total %
statement 11 11 100.0
branch 5 8 62.5
condition 1 2 50.0
subroutine 2 2 100.0
pod 0 1 0.0
total 19 24 79.1


line stmt bran cond sub pod time code
1             package Khonsu::Page::Footer;
2              
3 5     5   34 use parent 'Khonsu::Page::Header';
  5         11  
  5         33  
4              
5             sub render {
6 89     89 0 414 my ($self, $file) = @_;
7 89 100       420 return unless $self->active();
8 86         412 my $y = ($file->page->h - $self->h) + (($self->h / 2) - ($self->font->size / 2));
9 86 50       528 my $w = $file->page->w - ($self->padding ? ( $self->padding * 2 ) : $self->padding);
10 86   50     378 my $x = $self->padding || 0;
11 86 50       405 if ($self->show_page_num) {
12 86         450 $self->add(
13             $file,
14             text => $self->process_page_num_text($file),
15             y => $y,
16             w => $w,
17             x => $x,
18             h => $self->h,
19             align => $self->show_page_num
20             );
21             }
22              
23 86 50       579 $self->cb->(
24             $self,
25             $file,
26             y => $y,
27             w => $w,
28             x => $x,
29             h => $self->h,
30             ) if ($self->cb);
31             }
32              
33             1;