| 1 | package Bio::Graphics::Glyph::hat; | ||
| 2 | # a simple inverted V (used by DAS) | ||
| 3 | |||
| 4 | use strict; | ||
| 5 | use base qw(Bio::Graphics::Glyph::line); | ||
| 6 | |||
| 7 | sub my_description { | ||
| 8 | return <<END; | ||
| 9 | This glyph draws an inverted V spanning the feature. | ||
| 10 | END | ||
| 11 | } | ||
| 12 | |||
| 13 | sub draw_connector { | ||
| 14 | my $self = shift; | ||
| 15 | my $gd = shift; | ||
| 16 | my ($left,$right,$high,$low) = @_; | ||
| 17 | my $fg = $self->fgcolor; | ||
| 18 | my $center = ($high+$low)/2; | ||
| 19 | my $middle = ($left+$right)/2; | ||
| 20 | $gd->line($left,$center,$middle,$high,$fg); | ||
| 21 | $gd->line($middle,$high,$right,$center,$fg); | ||
| 22 | } | ||
| 23 | |||
| 24 | 1; | ||
| 25 | |||
| 26 | __END__ |