| 1 | package Graphics::Primitive::Driver::TextLayout; | ||
| 2 | use Moose::Role; | ||
| 3 | |||
| 4 | requires 'slice'; | ||
| 5 | |||
| 6 | has 'component' => ( | ||
| 7 | is => 'rw', | ||
| 8 | isa => 'Graphics::Primitive::TextBox', | ||
| 9 | required => 1, | ||
| 10 | weak_ref => 1 | ||
| 11 | ); | ||
| 12 | has 'height' => ( | ||
| 13 | is => 'rw', | ||
| 14 | isa => 'Num', | ||
| 15 | default => sub { -1 } | ||
| 16 | ); | ||
| 17 | has 'width' => ( | ||
| 18 | is => 'rw', | ||
| 19 | isa => 'Num', | ||
| 20 | lazy => 1, | ||
| 21 | default => sub { my ($self) = @_; $self->component->width } | ||
| 22 | ); | ||
| 23 | |||
| 24 | no Moose; | ||
| 25 | 1; | ||
| 26 | __END__; |