Branch Coverage

blib/lib/SDLx/Text.pm
Criterion Covered Total %
branch 34 94 36.1


line true false branch
18 0 1 unless ('SDL::Config'->has('SDL_ttf'))
22 0 1 unless ($file)
27 0 1 defined $options{'color'} ? :
35 0 1 defined $options{'shadow_color'} ? :
47 1 0 unless (SDL::TTF::was_init())
48 0 1 unless SDL::TTF::init() == 0
59 0 1 if exists $options{'bold'}
60 0 1 if exists $options{'italic'}
61 0 1 if exists $options{'underline'}
62 0 1 if exists $options{'strikethrough'}
67 0 1 if exists $options{'text'}
75 1 2 if ($font_filename)
78 0 1 unless $self->{'_font'} = SDL::TTF::open_font($font_filename, $size)
95 1 1 if (defined $color)
106 1 2 if ($size)
124 0 0 if (@_ > 2) { }
127 0 0 if ($enable) { }
131 0 0 if $flag & $styles
156 0 1 if ($align)
167 0 1 if ($shadow)
178 1 0 if (defined $shadow_color)
190 1 0 if ($shadow_offset)
200 2 0 unless $surface and ref $surface eq 'ARRAY'
202 0 0 $_ ? :
207 1 0 unless $surface and ref $surface eq 'ARRAY'
209 0 0 $_ ? :
215 0 1 if (defined $x)
224 0 1 if (defined $y)
233 1 2 if scalar @_ == 1
235 1 1 if (defined $text) { }
236 0 1 if $self->{'word_wrap'}
239 0 1 unless my $surface = _get_surfaces_for($font, $text, $self->{'_color'})
241 0 1 if ($self->{'shadow'})
243 0 0 unless my $shadow_surface = _get_surfaces_for($font, $text, $self->{'shadow_color'})
245 0 0 unless ref $shadow_surface eq 'ARRAY'
267 1 0 if index($text, "\n") == -1
296 0 0 if ($w < $maxlen) { }
303 0 0 if substr($paragraph_output[-1], -1, 1) eq ' '
321 0 0 if (@_ > 2)
331 0 0 if (@_ > 4) { }
0 0 elsif ($self->{'_update_surfaces'}) { }
340 0 0 if (my $surfaces = $self->{'surface'})
342 0 0 unless ref $surfaces eq 'ARRAY'
346 0 0 if (my $surface = $surfaces->[$i])
350 0 0 if ($self->{'h_align'} eq 'center') { }
0 0 elsif ($self->{'h_align'} eq 'right') { }
360 0 0 if ($self->{'shadow'})