# File lib/bio/graphics/track.rb, line 93
  def add_feature(feature_object, opts = {})
    # Calculate the ultimate start and stop of the feature: the start
    # of the first subfeature (e.g. exon) and the stop of the last one.
    # The only reason we want to know these positions, is because we want
    # to determine if the feature falls within the view of the image or
    # not (see below).
    start = feature_object.locations.collect{|l| l.from}.min.to_i
    stop = feature_object.locations.collect{|l| l.to}.max.to_i

    # If the feature wouldn't show because it's not in the region we're
    # looking at, don't bother storing the stuff. I think this makes huge
    # speed and memory differences if you've got a chromosome with
    # thousands of features.
    if stop <= self.panel.display_start or start >= self.panel.display_stop
      return nil
    else #elsif start >= panel.display_start and stop <= panel.display_stop
      @features.push(Bio::Graphics::Feature.new(self, feature_object, opts))
      return @features[-1]
    end

    return self
  end