| 1 | use Renard::Incunabula::Common::Setup; | ||
| 2 | package Intertangle::Jacquard::Role::Render::QnD::Cairo::Group; | ||
| 3 | # ABSTRACT: Quick-and-dirty Cairo group rendering | ||
| 4 | $Intertangle::Jacquard::Role::Render::QnD::Cairo::Group::VERSION = '0.001'; | ||
| 5 | use Mu::Role; | ||
| 6 | |||
| 7 | method render_cairo($cr) { | ||
| 8 | $cr->save; | ||
| 9 | my $matrix = Cairo::Matrix->init_translate( $self->x->value, $self->y->value ) | ||
| 10 | ->multiply( | ||
| 11 | $cr->get_matrix | ||
| 12 | ); | ||
| 13 | $cr->set_matrix( $matrix ); | ||
| 14 | for my $child (@{$self->children}) { | ||
| 15 | $child->render_cairo($cr); | ||
| 16 | } | ||
| 17 | $cr->restore; | ||
| 18 | } | ||
| 19 | |||
| 20 | with qw(Intertangle::Jacquard::Role::Render::QnD::Cairo); | ||
| 21 | |||
| 22 | 1; | ||
| 23 | |||
| 24 | __END__ | ||
| 25 | |||
| 26 | =pod | ||
| 27 | |||
| 28 | =encoding UTF-8 | ||
| 29 | |||
| 30 | =head1 NAME | ||
| 31 | |||
| 32 | Intertangle::Jacquard::Role::Render::QnD::Cairo::Group - Quick-and-dirty Cairo group rendering | ||
| 33 | |||
| 34 | =head1 VERSION | ||
| 35 | |||
| 36 | version 0.001 | ||
| 37 | |||
| 38 | =head1 CONSUMES | ||
| 39 | |||
| 40 | =over 4 | ||
| 41 | |||
| 42 | =item * L<Intertangle::Jacquard::Role::Render::QnD::Cairo> | ||
| 43 | |||
| 44 | =back | ||
| 45 | |||
| 46 | =head1 METHODS | ||
| 47 | |||
| 48 | =head2 render_cairo | ||
| 49 | |||
| 50 | ... | ||
| 51 | |||
| 52 | =head1 AUTHOR | ||
| 53 | |||
| 54 | Zakariyya Mughal <zmughal@cpan.org> | ||
| 55 | |||
| 56 | =head1 COPYRIGHT AND LICENSE | ||
| 57 | |||
| 58 | This software is copyright (c) 2017 by Zakariyya Mughal. | ||
| 59 | |||
| 60 | This is free software; you can redistribute it and/or modify it under | ||
| 61 | the same terms as the Perl 5 programming language system itself. | ||
| 62 | |||
| 63 | =cut |