# File lib/luck/listbox.rb, line 60 def fit_data_back offset=nil lines = -1 items = 0 offset ||= @offset data[([offset - height,0].max)..([offset,0].max)].reverse.each do |line| _height = line_height(line) if _height + lines >= height break else lines += _height items += 1 end end [lines, items] end