mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Refactor to unify computations related to tiles
This commit is contained in:
committed by
Antonio Scandurra
parent
09f8a52b9d
commit
aade501040
@@ -527,10 +527,8 @@ function clientLeftForCharacter (component, row, column) {
|
||||
|
||||
function lineNumberNodeForScreenRow (component, row) {
|
||||
const gutterElement = component.refs.lineNumberGutter.element
|
||||
const endRow = Math.min(component.getRenderedEndRow(), component.getModel().getApproximateScreenLineCount())
|
||||
const visibleTileCount = Math.ceil((endRow - component.getRenderedStartRow()) / component.getRowsPerTile())
|
||||
const tileStartRow = component.getTileStartRow(row)
|
||||
const tileIndex = (tileStartRow / component.getRowsPerTile()) % visibleTileCount
|
||||
const tileStartRow = component.tileStartRowForRow(row)
|
||||
const tileIndex = component.tileIndexForTileStartRow(tileStartRow)
|
||||
return gutterElement.children[tileIndex].children[row - tileStartRow]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user