| 1 | package Bio::Graphics::Glyph::crossbox; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use base qw(Bio::Graphics::Glyph::generic); | ||
| 5 | |||
| 6 | sub my_description { | ||
| 7 | "This is a box with an 'X' inside the glyph." | ||
| 8 | } | ||
| 9 | |||
| 10 | # override draw_component to draw a crossed box rather than empty | ||
| 11 | sub draw_component { | ||
| 12 | my $self = shift; | ||
| 13 | my $gd = shift; | ||
| 14 | my $fg = $self->fgcolor; | ||
| 15 | my ($left,$top) = @_; | ||
| 16 | my($x1,$y1,$x2,$y2) = $self->bounds(@_); | ||
| 17 | $self->filled_box($gd, | ||
| 18 | $x1, $y1, | ||
| 19 | $x2, $y2); | ||
| 20 | |||
| 21 | $gd->line($x1,$y1,$x2,$y2,$fg); | ||
| 22 | $gd->line($x1,$y2,$x2,$y1,$fg); | ||
| 23 | } | ||
| 24 | |||
| 25 | |||
| 26 | 1; | ||
| 27 | |||
| 28 | __END__ |