Skip to content

Commit

Permalink
Merge pull request #135081 from AiverReaver/minimapScrollFix
Browse files Browse the repository at this point in the history
fixed minimap slider width when page is scroll horizontally.
  • Loading branch information
alexdima committed Oct 22, 2021
2 parents aa5b9d7 + 55524be commit a2a1c4b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/vs/editor/browser/viewParts/minimap/minimap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1389,10 +1389,8 @@ class InnerMinimap extends Disposable {
this._slider.setHeight(layout.sliderHeight);

// Compute horizontal slider coordinates
const scrollLeftChars = renderingCtx.scrollLeft / this._model.options.typicalHalfwidthCharacterWidth;
const horizontalSliderLeft = Math.min(this._model.options.minimapWidth, Math.round(scrollLeftChars * this._model.options.minimapCharWidth / this._model.options.pixelRatio));
this._sliderHorizontal.setLeft(horizontalSliderLeft);
this._sliderHorizontal.setWidth(this._model.options.minimapWidth - horizontalSliderLeft);
this._sliderHorizontal.setLeft(0);
this._sliderHorizontal.setWidth(this._model.options.minimapWidth);
this._sliderHorizontal.setTop(0);
this._sliderHorizontal.setHeight(layout.sliderHeight);

Expand Down

0 comments on commit a2a1c4b

Please sign in to comment.