Skip to content

Commit

Permalink
🐛 Adjust outline decoration rendering so that it doesn't leak over ne…
Browse files Browse the repository at this point in the history
…xt lines
  • Loading branch information
abe33 committed Aug 9, 2017
1 parent 6c856b9 commit 8d0b51c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/mixins/canvas-drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ module.exports = class CanvasDrawer extends Mixin {
xEnd = xStart + width

data.context.fillRect(xStart, yStart, width, 1)
data.context.fillRect(xStart, yEnd, width, 1)
data.context.fillRect(xStart, yEnd - 1, width, 1)
data.context.fillRect(xStart, yStart, 1, lineHeight)
data.context.fillRect(xEnd, yStart, 1, lineHeight)
} else if (rowSpan === 1) {
Expand All @@ -668,15 +668,15 @@ module.exports = class CanvasDrawer extends Mixin {
bottomWidth = data.canvasWidth - xBottomStart

data.context.fillRect(xStart, yStart, width, 1)
data.context.fillRect(xBottomStart, yEnd, bottomWidth, 1)
data.context.fillRect(xBottomStart, yEnd - 1, bottomWidth, 1)
data.context.fillRect(xStart, yStart, 1, lineHeight)
data.context.fillRect(canvasWidth - 1, yStart, 1, lineHeight)
} else {
width = canvasWidth - xStart
bottomWidth = canvasWidth - xEnd

data.context.fillRect(0, yStart, xStart, 1)
data.context.fillRect(0, yEnd, xEnd, 1)
data.context.fillRect(0, yEnd - 1, xEnd, 1)
data.context.fillRect(0, yStart, 1, lineHeight)
data.context.fillRect(xEnd, yStart, 1, lineHeight)
}
Expand All @@ -692,7 +692,7 @@ module.exports = class CanvasDrawer extends Mixin {
} else if (screenRow === range.end.row) {
width = canvasWidth - xStart

data.context.fillRect(0, yEnd, xEnd, 1)
data.context.fillRect(0, yEnd - 1, xEnd, 1)
data.context.fillRect(0, yStart, 1, lineHeight)
data.context.fillRect(xEnd, yStart, 1, lineHeight)
} else {
Expand All @@ -702,7 +702,7 @@ module.exports = class CanvasDrawer extends Mixin {
data.context.fillRect(0, yStart, xStart, 1)
}
if (screenRow === range.end.row - 1) {
data.context.fillRect(xEnd, yEnd, canvasWidth - xEnd, 1)
data.context.fillRect(xEnd, yEnd - 1, canvasWidth - xEnd, 1)
}
}
}
Expand Down

0 comments on commit 8d0b51c

Please sign in to comment.