Taffeta/Graphics/Role/CairoRenderable/WithCairoPath.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 3 Podpod n/a totaltotal 0.0% 0 / 44 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 use Renard::Incunabula::Common::Setup;
2 package Intertangle::Taffeta::Graphics::Role::CairoRenderable::WithCairoPath;
3 # ABSTRACT: A role to help draw a Cairo path with styles/transformations
4 $Intertangle::Taffeta::Graphics::Role::CairoRenderable::WithCairoPath::VERSION = '0.001';
5 use Moo::Role;
6 use Intertangle::Taffeta::Types qw(CairoContext);
7  
8 method cairo_path( (CairoContext) $cr ) {
9 ...
10 }
11  
12  
13 method render_cairo( (CairoContext) $cr ) {
14 $cr->save;
15  
16 $cr->set_matrix(
17 $self->transform->cairo_matrix
18 );
19  
20 if( $self->has_fill && ! $self->fill->is_fill_none ) {
21 $cr->set_source_rgba(
22 $self->fill->color->rgb_float_triple,
23 $self->fill->opacity);
24  
25 $self->cairo_path( $cr );
26 $cr->fill;
27 }
28 if( $self->has_stroke && ! $self->stroke->is_stroke_none ) {
29 $cr->set_line_width( $self->stroke->width );
30 $cr->set_source_rgba(
31 $self->stroke->color->rgb_float_triple,
32 $self->stroke->opacity);
33  
34 $self->cairo_path( $cr );
35 $cr->stroke;
36 }
37  
38 $cr->restore;
39 }
40  
41 with qw(
42 Intertangle::Taffeta::Graphics::Role::CairoRenderable
43 );
44  
45 1;
46  
47 __END__