Skip to content

Commit 9fde1ae

Browse files
committed
Improve warning check
1 parent 22e83f2 commit 9fde1ae

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ export class MinimapCharRenderer {
3939
): void {
4040
const charWidth = Constants.BASE_CHAR_WIDTH * this.scale;
4141
const charHeight = Constants.BASE_CHAR_HEIGHT * this.scale;
42-
if (dx + charWidth > target.width || dy + charHeight > target.height) {
42+
const renderHeight = (force1pxHeight ? 1 : charHeight);
43+
if (dx + charWidth > target.width || dy + renderHeight > target.height) {
4344
console.warn('bad render request outside image data');
4445
return;
4546
}
@@ -61,7 +62,6 @@ export class MinimapCharRenderer {
6162
let sourceOffset = charIndex * charWidth * charHeight;
6263

6364
let row = dy * destWidth + dx * Constants.RGBA_CHANNELS_CNT;
64-
const renderHeight = (force1pxHeight ? 1 : charHeight);
6565
for (let y = 0; y < renderHeight; y++) {
6666
let column = row;
6767
for (let x = 0; x < charWidth; x++) {

0 commit comments

Comments
 (0)