From a81abbea715d329691272b3cb5d13317a50d3913 Mon Sep 17 00:00:00 2001 From: abe33 Date: Wed, 5 Apr 2017 10:48:49 +0200 Subject: [PATCH] :bug: Fix flickers on retina screen with absolute mode adjustable height --- lib/minimap-element.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/minimap-element.js b/lib/minimap-element.js index bdde7c90..e3396dd0 100644 --- a/lib/minimap-element.js +++ b/lib/minimap-element.js @@ -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,