| 1 | package Bio::Graphics::Glyph::saw_teeth; | ||
| 2 | # DAS-compatible package to use for drawing a line of saw teeth | ||
| 3 | |||
| 4 | use strict; | ||
| 5 | use base qw(Bio::Graphics::Glyph::repeating_shape); | ||
| 6 | |||
| 7 | sub draw_repeating_shape | ||
| 8 | { | ||
| 9 | my ($self, $gd, $x1, $y1, $x2, $y2, $fg) = @_; | ||
| 10 | |||
| 11 | my $midX = ($x2-$x1) / 2 + $x1; | ||
| 12 | $gd->line($x1,$y2,$midX,$y1,$fg); | ||
| 13 | $gd->line($midX,$y1,$x2,$y2,$fg); | ||
| 14 | } | ||
| 15 | |||
| 16 | 1; | ||
| 17 | |||
| 18 | __END__ |