Disable translate3D for list when scaling (fixes #24599)

This commit is contained in:
Benjamin Pasero
2017-04-18 15:11:34 +02:00
parent c4d5d01cc4
commit 30f83907e1
4 changed files with 40 additions and 26 deletions

View File

@@ -13,6 +13,8 @@ import { ScrollEvent, ScrollbarVisibility } from 'vs/base/common/scrollable';
import { RangeMap, IRange, relativeComplement, each } from './rangeMap';
import { IDelegate, IRenderer } from './list';
import { RowCache, IRow } from './rowCache';
import { isWindows } from "vs/base/common/platform";
import { canUseTranslate3d } from "vs/base/browser/browser";
interface IItem<T> {
id: string;
@@ -179,9 +181,14 @@ export class ListView<T> implements IDisposable {
rangesToInsert.forEach(range => each(range, i => this.insertItemInDOM(this.items[i], i)));
rangesToRemove.forEach(range => each(range, i => this.removeItemFromDOM(this.items[i])));
const transform = `translate3d(0px, -${renderTop}px, 0px)`;
this.rowsContainer.style.transform = transform;
this.rowsContainer.style.webkitTransform = transform;
if (canUseTranslate3d() && !isWindows /* Windows: translate3d breaks subpixel-antialias (ClearType) unless a background is defined */) {
const transform = `translate3d(0px, -${renderTop}px, 0px)`;
this.rowsContainer.style.transform = transform;
this.rowsContainer.style.webkitTransform = transform;
} else {
this.rowsContainer.style.top = `-${renderTop}px`;
}
this.lastRenderTop = renderTop;
this.lastRenderHeight = renderHeight;
}