Skip to content

Commit

Permalink
Enlarge the x scale in order to visualize all the labels of the featu…
Browse files Browse the repository at this point in the history
…res (see issue danmaclean#4).
  • Loading branch information
yp committed Jan 3, 2014
1 parent a9186bc commit f4980c2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/bio/graphics/page.rb
Original file line number Diff line number Diff line change
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 f4980c2

Please sign in to comment.