Skip to content

Commit

Permalink
fixed the git problems
Browse files Browse the repository at this point in the history
  • Loading branch information
pouyakary committed Apr 10, 2024
1 parent 0cf094b commit ac91d42
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/vs/editor/browser/viewParts/minimap/minimap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1804,6 +1804,7 @@ class InnerMinimap extends Disposable {
const separatorStroke = foregroundFill;

const canvasContext = this._decorationsCanvas.domNode.getContext('2d')!;
canvasContext.letterSpacing = sectionHeaderLetterSpacing + 'px';
canvasContext.font = '500 ' + sectionHeaderFontSize + 'px ' + this._model.options.sectionHeaderFontFamily;
canvasContext.strokeStyle = separatorStroke;
canvasContext.lineWidth = 0.2;
Expand Down Expand Up @@ -1831,7 +1832,8 @@ class InnerMinimap extends Disposable {
backgroundFillY,
backgroundFillHeight,
y,
separatorY);
separatorY,
);
}
}

Expand Down Expand Up @@ -1886,16 +1888,7 @@ class InnerMinimap extends Disposable {
target.fillRect(0, backgroundFillY, minimapWidth, backgroundFillHeight);

target.fillStyle = foregroundFill;

// Canvas doesn't have a direct api for letter spacing, and therefore
// we need to do it ourselves, by rendering and measuring each character
// individually.
let x = MINIMAP_GUTTER_WIDTH;
for (const visibleCharacter of [...headerText]) {
target.fillText(visibleCharacter, x, textY);
const charWidth = target.measureText(visibleCharacter).width;
x += charWidth + letterSpacing;
}
target.fillText(headerText, MINIMAP_GUTTER_WIDTH, textY);
}

if (hasSeparatorLine) {
Expand Down

0 comments on commit ac91d42

Please sign in to comment.