Class: Bio::Graphics::Glyph::Triangle

Inherits:
Common
  • Object
show all
Defined in:
lib/bio/graphics/glyphs/triangle.rb

Instance Attribute Summary

Attributes inherited from Common

#feature_context, #subfeature

Instance Method Summary collapse

Methods inherited from Common

#initialize, #left_pixel, #right_pixel

Constructor Details

This class inherits a constructor from Bio::Graphics::Glyph::Common

Instance Method Details

#drawObject



11
12
13
14
15
16
# File 'lib/bio/graphics/glyphs/triangle.rb', line 11

def draw
  raise "Start and stop are not the same (necessary if you want triangle glyphs)" if @subfeature.start != @subfeature.stop
  
  arrow(@feature_context,:north, self.left_pixel + Bio::Graphics::FEATURE_ARROW_LENGTH, 0, Bio::Graphics::FEATURE_ARROW_LENGTH)
  @feature_context.close_path.stroke
end