Merge pull request #15550 from atom/as-fix-rendering-out-of-range-decorations

Don't render block decorations located outside the visible range
This commit is contained in:
Antonio Scandurra
2017-09-06 02:11:16 -07:00
committed by GitHub
2 changed files with 30 additions and 3 deletions

View File

@@ -1153,9 +1153,11 @@ class TextEditorComponent {
}
addBlockDecorationToRender (decoration, screenRange, reversed) {
const screenPosition = reversed ? screenRange.start : screenRange.end
const tileStartRow = this.tileStartRowForRow(screenPosition.row)
const screenLine = this.renderedScreenLines[screenPosition.row - this.getRenderedStartRow()]
const {row} = reversed ? screenRange.start : screenRange.end
if (row < this.getRenderedStartRow() || row >= this.getRenderedEndRow()) return
const tileStartRow = this.tileStartRowForRow(row)
const screenLine = this.renderedScreenLines[row - this.getRenderedStartRow()]
let decorationsByScreenLine = this.decorationsToRender.blocks.get(tileStartRow)
if (!decorationsByScreenLine) {