Class: Bio::Graphics::Glyph::Dot

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

Instance Attribute Summary collapse

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 Attribute Details

#radiusObject

Returns the value of attribute radius.



11
12
13
# File 'lib/bio/graphics/glyphs/dot.rb', line 11

def radius
  @radius
end

Instance Method Details

#drawObject



13
14
15
16
17
18
19
# File 'lib/bio/graphics/glyphs/dot.rb', line 13

def draw
  raise "Start and stop are not the same (necessary if you want triangle glyphs)" if @subfeature.start != @subfeature.stop
  
  @radius = Bio::Graphics::FEATURE_HEIGHT/2
  @feature_context.circle(self.left_pixel + @radius, @radius, @radius).fill
  @feature_context.close_path.stroke
end