本文整理匯總了TypeScript中vs/editor/browser/viewLayout/layoutProvider.ILayoutProvider類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ILayoutProvider類的具體用法?TypeScript ILayoutProvider怎麽用?TypeScript ILayoutProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ILayoutProvider類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor(context:ViewContext, layoutProvider:ILayoutProvider) {
super();
this._context = context;
this._lineHeight = this._context.configuration.editor.lineHeight;
this._readOnly = this._context.configuration.editor.readOnly;
this._layoutProvider = layoutProvider;
this._selectionIsEmpty = true;
this._primaryCursorIsInEditableRange = true;
this._primaryCursorLineNumber = 1;
this._scrollWidth = this._layoutProvider.getScrollWidth();
this._context.addEventHandler(this);
}
示例2: onModelFlushed
public onModelFlushed(): boolean {
this._primaryCursorIsInEditableRange = true;
this._selectionIsEmpty = true;
this._primaryCursorLineNumber = 1;
this._scrollWidth = this._layoutProvider.getScrollWidth();
return true;
}
示例3: render
public render(ctx: IRestrictedRenderingContext): void {
if (this._canUseTranslate3d) {
let transform = 'translate3d(0px, ' + ctx.linesViewportData.visibleRangesDeltaTop + 'px, 0px)';
StyleMutator.setTransform(this.domNode, transform);
StyleMutator.setTop(this.domNode, 0);
} else {
StyleMutator.setTransform(this.domNode, '');
StyleMutator.setTop(this.domNode, ctx.linesViewportData.visibleRangesDeltaTop);
}
let height = Math.min(this._layoutProvider.getTotalHeight(), 1000000);
StyleMutator.setHeight(this.domNode, height);
StyleMutator.setWidth(this.domNode, this._contentLeft);
this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft);
this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth);
this._glyphMarginBackgroundDomNode.setHeight(height);
}