Move canUseTranslate3d to listView.ts, its only consumer

This commit is contained in:
Alex Dima
2017-08-28 11:19:11 +02:00
parent c0018cf640
commit 4ce04c6dfb
2 changed files with 23 additions and 24 deletions

View File

@@ -14,7 +14,29 @@ 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';
import * as browser from 'vs/base/browser/browser';
function canUseTranslate3d(): boolean {
if (browser.isFirefox) {
return false;
}
if (browser.getZoomLevel() !== 0) {
return false;
}
// see https://github.com/Microsoft/vscode/issues/24483
if (browser.isChromev56) {
const pixelRatio = browser.getPixelRatio();
if (Math.floor(pixelRatio) !== pixelRatio) {
// Not an integer
return false;
}
}
return true;
}
interface IItem<T> {
id: string;