     zIndex = 0
 
     for tileStartRow in [@tileForRow(endRow)..@tileForRow(startRow)] by -@tileSize
-      tileEndRow = @constrainRow(tileStartRow + @tileSize)
       rowsWithinTile = []
 
       while screenRowIndex >= 0

    screenRows = [startRow...endRow]
    if longestScreenRow = @model.getLongestScreenRow()
      screenRows.push(longestScreenRow)
    if @screenRows?
      screenRows.push(@screenRows...)

    screenRows = screenRows.filter (row) => @constrainRow(row) is row
    screenRows.sort (a, b) -> a - b
    _.uniq(screenRows, true)


  getEndTileRow: ->
    @constrainRow(@tileForRow(@endRow))

  isValidScreenRow: (screenRow) ->
    screenRow >= 0 and screenRow < @model.getScreenLineCount()

  getScreenRows: ->
    startRow = @getStartTileRow()
    endRow = @constrainRow(@getEndTileRow() + @tileSize)
