Skip to content

Commit

Permalink
🐛 Fix missing lines when scrolling up
Browse files Browse the repository at this point in the history
  • Loading branch information
abe33 committed Apr 21, 2016
1 parent b7b0a3b commit 4fe360f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/mixins/canvas-drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export default class CanvasDrawer extends Mixin {
for (let i = 0, len = ranges.length; i < len; i++) {
const range = ranges[i]

method.call(this, currentRow, range.start - 1, currentRow - firstRow)
method.call(this, currentRow, range.start, currentRow - firstRow)

currentRow = range.end
}
Expand Down Expand Up @@ -477,6 +477,7 @@ export default class CanvasDrawer extends Mixin {
let y = offsetRow * lineHeight
for (let tokens of this.tokenLinesForScreenRows(firstRow, lastRow)) {
let x = 0
context.clearRect(x, y, canvasWidth, lineHeight)
for (let token of tokens) {
if (/^\s+$/.test(token.value)) {
x += token.value.length * charWidth
Expand Down Expand Up @@ -593,6 +594,11 @@ export default class CanvasDrawer extends Mixin {
drawDecorations (screenRow, decorations, renderData, types) {
let decorationsToRender = []

renderData.context.clearRect(
0, renderData.yRow,
renderData.canvasWidth, renderData.lineHeight
)

for (let i in types) {
decorationsToRender = decorationsToRender.concat(
decorations[i] != null ? decorations[i][screenRow] || [] : []
Expand Down

0 comments on commit 4fe360f

Please sign in to comment.