| 1 | package Bio::Graphics::Glyph::ellipse; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use base qw(Bio::Graphics::Glyph::generic); | ||
| 5 | |||
| 6 | sub my_description { | ||
| 7 | return <<END; | ||
| 8 | This glyph draws an oval instead of a box; otherwise it is similar to | ||
| 9 | the "generic" or "box" glyphs. The width of the oval is determined by | ||
| 10 | the feature width, and the height by the -height option. | ||
| 11 | END | ||
| 12 | } | ||
| 13 | |||
| 14 | |||
| 15 | # override draw_component to draw an oval rather than a rectangle (weird) | ||
| 16 | sub draw_component { | ||
| 17 | my $self = shift; | ||
| 18 | my $gd = shift; | ||
| 19 | my ($left,$top) = @_; | ||
| 20 | my($x1,$y1,$x2,$y2) = $self->bounds(@_); | ||
| 21 | $self->filled_oval($gd, | ||
| 22 | $x1, $y1, | ||
| 23 | $x2, $y2); | ||
| 24 | |||
| 25 | $self->draw_label($gd,@_) if $self->option('label'); | ||
| 26 | } | ||
| 27 | |||
| 28 | 1; | ||
| 29 | |||
| 30 | __END__ |