From 4c6b9332347d87e30caf963f37b4fa259a0d52a0 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 6 May 2020 16:02:40 +0200 Subject: [PATCH] Avoid rendering attempts outside the canvas --- src/vs/editor/browser/viewParts/minimap/minimap.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/browser/viewParts/minimap/minimap.ts b/src/vs/editor/browser/viewParts/minimap/minimap.ts index 6a9058b113a..1c1e3d7ade1 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimap.ts +++ b/src/vs/editor/browser/viewParts/minimap/minimap.ts @@ -263,7 +263,8 @@ class MinimapLayout { const computedSliderRatio = (maxMinimapSliderTop) / (scrollHeight - viewportHeight); const sliderTop = (scrollTop * computedSliderRatio); const sliderNeeded = (maxMinimapSliderTop > 0); - return new MinimapLayout(scrollTop, scrollHeight, sliderNeeded, computedSliderRatio, sliderTop, sliderHeight, 1, lineCount); + const maxLinesFitting = Math.floor(options.canvasInnerHeight / options.minimapLineHeight); + return new MinimapLayout(scrollTop, scrollHeight, sliderNeeded, computedSliderRatio, sliderTop, sliderHeight, 1, Math.min(lineCount, maxLinesFitting)); } // The visible line count in a viewport can change due to a number of reasons: