提交 fc6f0922 编写于 作者: A Alex Dima

Do not use translate3d in overview ruler, use will-change instead (Microsoft/monaco-editor#426)

上级 38f89523
...@@ -46,7 +46,6 @@ export class DecorationsOverviewRuler extends ViewPart { ...@@ -46,7 +46,6 @@ export class DecorationsOverviewRuler extends ViewPart {
'decorationsOverviewRuler', 'decorationsOverviewRuler',
this._context.viewLayout.getScrollHeight(), this._context.viewLayout.getScrollHeight(),
this._context.configuration.editor.lineHeight, this._context.configuration.editor.lineHeight,
this._context.configuration.editor.canUseTranslate3d,
this._context.configuration.editor.pixelRatio, this._context.configuration.editor.pixelRatio,
DecorationsOverviewRuler.MIN_DECORATION_HEIGHT, DecorationsOverviewRuler.MIN_DECORATION_HEIGHT,
DecorationsOverviewRuler.MAX_DECORATION_HEIGHT, DecorationsOverviewRuler.MAX_DECORATION_HEIGHT,
...@@ -101,10 +100,6 @@ export class DecorationsOverviewRuler extends ViewPart { ...@@ -101,10 +100,6 @@ export class DecorationsOverviewRuler extends ViewPart {
this._overviewRuler.setLineHeight(this._context.configuration.editor.lineHeight, false); this._overviewRuler.setLineHeight(this._context.configuration.editor.lineHeight, false);
} }
if (e.canUseTranslate3d) {
this._overviewRuler.setCanUseTranslate3d(this._context.configuration.editor.canUseTranslate3d, false);
}
if (e.pixelRatio) { if (e.pixelRatio) {
this._overviewRuler.setPixelRatio(this._context.configuration.editor.pixelRatio, false); this._overviewRuler.setPixelRatio(this._context.configuration.editor.pixelRatio, false);
} }
......
...@@ -25,7 +25,6 @@ export class OverviewRuler extends ViewEventHandler implements IOverviewRuler { ...@@ -25,7 +25,6 @@ export class OverviewRuler extends ViewEventHandler implements IOverviewRuler {
cssClassName, cssClassName,
this._context.viewLayout.getScrollHeight(), this._context.viewLayout.getScrollHeight(),
this._context.configuration.editor.lineHeight, this._context.configuration.editor.lineHeight,
this._context.configuration.editor.canUseTranslate3d,
this._context.configuration.editor.pixelRatio, this._context.configuration.editor.pixelRatio,
minimumHeight, minimumHeight,
maximumHeight, maximumHeight,
...@@ -48,10 +47,6 @@ export class OverviewRuler extends ViewEventHandler implements IOverviewRuler { ...@@ -48,10 +47,6 @@ export class OverviewRuler extends ViewEventHandler implements IOverviewRuler {
this._overviewRuler.setLineHeight(this._context.configuration.editor.lineHeight, true); this._overviewRuler.setLineHeight(this._context.configuration.editor.lineHeight, true);
} }
if (e.canUseTranslate3d) {
this._overviewRuler.setCanUseTranslate3d(this._context.configuration.editor.canUseTranslate3d, true);
}
if (e.pixelRatio) { if (e.pixelRatio) {
this._overviewRuler.setPixelRatio(this._context.configuration.editor.pixelRatio, true); this._overviewRuler.setPixelRatio(this._context.configuration.editor.pixelRatio, true);
} }
......
...@@ -10,6 +10,7 @@ import { OverviewZoneManager, ColorZone, OverviewRulerZone } from 'vs/editor/com ...@@ -10,6 +10,7 @@ import { OverviewZoneManager, ColorZone, OverviewRulerZone } from 'vs/editor/com
import { Color } from 'vs/base/common/color'; import { Color } from 'vs/base/common/color';
import { OverviewRulerPosition } from 'vs/editor/common/config/editorOptions'; import { OverviewRulerPosition } from 'vs/editor/common/config/editorOptions';
import { ThemeType, LIGHT } from 'vs/platform/theme/common/themeService'; import { ThemeType, LIGHT } from 'vs/platform/theme/common/themeService';
import * as dom from 'vs/base/browser/dom';
export class OverviewRulerImpl { export class OverviewRulerImpl {
...@@ -17,12 +18,11 @@ export class OverviewRulerImpl { ...@@ -17,12 +18,11 @@ export class OverviewRulerImpl {
private _domNode: FastDomNode<HTMLCanvasElement>; private _domNode: FastDomNode<HTMLCanvasElement>;
private _lanesCount: number; private _lanesCount: number;
private _zoneManager: OverviewZoneManager; private _zoneManager: OverviewZoneManager;
private _canUseTranslate3d: boolean;
private _background: Color; private _background: Color;
constructor( constructor(
canvasLeftOffset: number, cssClassName: string, scrollHeight: number, lineHeight: number, canvasLeftOffset: number, cssClassName: string, scrollHeight: number, lineHeight: number,
canUseTranslate3d: boolean, pixelRatio: number, minimumHeight: number, maximumHeight: number, pixelRatio: number, minimumHeight: number, maximumHeight: number,
getVerticalOffsetForLine: (lineNumber: number) => number getVerticalOffsetForLine: (lineNumber: number) => number
) { ) {
this._canvasLeftOffset = canvasLeftOffset; this._canvasLeftOffset = canvasLeftOffset;
...@@ -31,10 +31,10 @@ export class OverviewRulerImpl { ...@@ -31,10 +31,10 @@ export class OverviewRulerImpl {
this._domNode.setClassName(cssClassName); this._domNode.setClassName(cssClassName);
this._domNode.setPosition('absolute'); this._domNode.setPosition('absolute');
dom.hintGPULayer(this._domNode.domNode);
this._lanesCount = 3; this._lanesCount = 3;
this._canUseTranslate3d = canUseTranslate3d;
this._background = null; this._background = null;
this._zoneManager = new OverviewZoneManager(getVerticalOffsetForLine); this._zoneManager = new OverviewZoneManager(getVerticalOffsetForLine);
...@@ -127,13 +127,6 @@ export class OverviewRulerImpl { ...@@ -127,13 +127,6 @@ export class OverviewRulerImpl {
} }
} }
public setCanUseTranslate3d(canUseTranslate3d: boolean, render: boolean): void {
this._canUseTranslate3d = canUseTranslate3d;
if (render) {
this.render(true);
}
}
public setPixelRatio(pixelRatio: number, render: boolean): void { public setPixelRatio(pixelRatio: number, render: boolean): void {
this._zoneManager.setPixelRatio(pixelRatio); this._zoneManager.setPixelRatio(pixelRatio);
this._domNode.setWidth(this._zoneManager.getDOMWidth()); this._domNode.setWidth(this._zoneManager.getDOMWidth());
...@@ -156,11 +149,6 @@ export class OverviewRulerImpl { ...@@ -156,11 +149,6 @@ export class OverviewRulerImpl {
if (this._zoneManager.getOuterHeight() === 0) { if (this._zoneManager.getOuterHeight() === 0) {
return false; return false;
} }
if (this._canUseTranslate3d) {
this._domNode.setTransform('translate3d(0px, 0px, 0px)');
} else {
this._domNode.setTransform('');
}
const width = this._zoneManager.getCanvasWidth(); const width = this._zoneManager.getCanvasWidth();
const height = this._zoneManager.getCanvasHeight(); const height = this._zoneManager.getCanvasHeight();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册