layers.inject(0) { |result, layer| [result, layer.scroll_end].max }