Skip to content

Commit

Permalink
🐛 Fix flickers on retina screen with absolute mode adjustable height
Browse files Browse the repository at this point in the history
  • Loading branch information
abe33 committed Apr 5, 2017
1 parent 050dcf5 commit a81abbe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/minimap-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -995,11 +995,16 @@ class MinimapElement {
}
}

updateCanvasesSize (canvasWidth = this.getFrontCanvas().width) {
updateCanvasesSize (canvasWidth) {
const devicePixelRatio = this.minimap.getDevicePixelRatio()
const maxCanvasHeight = this.height + this.minimap.getLineHeight()
const newHeight = this.absoluteMode && this.adjustAbsoluteModeHeight ? Math.min(this.minimap.getHeight(), maxCanvasHeight) : maxCanvasHeight
const canvas = this.getFrontCanvas()

if (canvasWidth == null) {
canvasWidth = canvas.width / devicePixelRatio
}

if (canvasWidth !== canvas.width || newHeight !== canvas.height) {
this.setCanvasesSize(
canvasWidth * devicePixelRatio,
Expand Down

0 comments on commit a81abbe

Please sign in to comment.