mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-25 17:27:26 +01:00
Fix overlay area for minimap slider
Since minimap always render from a complete line, we have to recalculate sliderTop with align offset.
This commit is contained in:
@@ -226,8 +226,7 @@ class MinimapLayout {
|
||||
* Compute a desired `scrollPosition` such that the slider moves by `delta`.
|
||||
*/
|
||||
public getDesiredScrollTopFromDelta(delta: number): number {
|
||||
const desiredSliderPosition = this.sliderTop + delta;
|
||||
return Math.round(desiredSliderPosition / this._computedSliderRatio);
|
||||
return Math.round(this.scrollTop + delta / this._computedSliderRatio);
|
||||
}
|
||||
|
||||
public getDesiredScrollTopFromTouchLocation(pageY: number): number {
|
||||
@@ -332,8 +331,9 @@ class MinimapLayout {
|
||||
}
|
||||
|
||||
const endLineNumber = Math.min(lineCount, startLineNumber + minimapLinesFitting - 1);
|
||||
const sliderTopAligned = (scrollTop / lineHeight - startLineNumber + 1) * minimapLineHeight / pixelRatio;
|
||||
|
||||
return new MinimapLayout(scrollTop, scrollHeight, true, computedSliderRatio, sliderTop, sliderHeight, startLineNumber, endLineNumber);
|
||||
return new MinimapLayout(scrollTop, scrollHeight, true, computedSliderRatio, sliderTopAligned, sliderHeight, startLineNumber, endLineNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user