Skip to content

Commit 6c8d3ea

Browse files
authored
fixed microsoft#173858 minimap slider not scrolling to the top end (microsoft#180728)
fixed div/0 in minimap slider position calculation also execute if block if scrollTop equals options.paddingTop this avoids div/0 in else block when options.paddingTop is 0
1 parent 4b947b8 commit 6c8d3ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vs/editor/browser/viewParts/minimap/minimap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ class MinimapLayout {
377377
const partialLine = (scrollTop - viewportStartLineNumberVerticalOffset) / lineHeight;
378378

379379
let sliderTopAligned: number;
380-
if (scrollTop > options.paddingTop) {
380+
if (scrollTop >= options.paddingTop) {
381381
sliderTopAligned = (viewportStartLineNumber - startLineNumber + topPaddingLineCount + partialLine) * minimapLineHeight / pixelRatio;
382382
} else {
383383
sliderTopAligned = (scrollTop / options.paddingTop) * (topPaddingLineCount + partialLine) * minimapLineHeight / pixelRatio;

0 commit comments

Comments
 (0)