Skip to content

Commit

Permalink
Merge branch 'scales'
Browse files Browse the repository at this point in the history
  • Loading branch information
yp committed Jan 3, 2014
2 parents 91901f0 + 23ba32a commit c6c617b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/bio/graphics/page.rb
Expand Up @@ -227,6 +227,18 @@ def get_limits
@scale_stop = highest if highest > @scale_stop
@nt_per_px_x = (@scale_stop - @scale_start).to_f / @width.to_f
end
begin
old_nt_per_px_x = @nt_per_px_x
@tracks.each do |track|
highest = track.features.map { |feat|
feat_end = feat.end
feat_end += (8 * @nt_per_px_x * feat.id.to_s.length).to_i if feat.id
feat_end
}.max
@scale_stop = highest if highest > @scale_stop
@nt_per_px_x = (@scale_stop - @scale_start).to_f / @width.to_f
end
end while (@nt_per_px_x - old_nt_per_px_x).abs > 1
end

#Adds scale bar to the list of objects to be rendered in the final
Expand Down

0 comments on commit c6c617b

Please sign in to comment.