本文整理汇总了TypeScript中vs/editor/common/view/renderingContext.IRenderingContext类的典型用法代码示例。如果您正苦于以下问题:TypeScript IRenderingContext类的具体用法?TypeScript IRenderingContext怎么用?TypeScript IRenderingContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IRenderingContext类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: _renderNormalDecorations
private _renderNormalDecorations(ctx: IRenderingContext, decorations: editorCommon.IModelDecoration[], output: string[]): void {
let lineHeight = String(this._lineHeight);
let visibleStartLineNumber = ctx.visibleRange.startLineNumber;
for (let i = 0, lenI = decorations.length; i < lenI; i++) {
let d = decorations[i];
if (d.options.isWholeLine) {
continue;
}
let linesVisibleRanges = ctx.linesVisibleRangesForRange(d.range, /*TODO@Alex*/d.options.className === 'findMatch');
if (!linesVisibleRanges) {
continue;
}
let className = d.options.className;
for (let j = 0, lenJ = linesVisibleRanges.length; j < lenJ; j++) {
let lineVisibleRanges = linesVisibleRanges[j];
let lineIndex = lineVisibleRanges.lineNumber - visibleStartLineNumber;
for (let k = 0, lenK = lineVisibleRanges.ranges.length; k < lenK; k++) {
let visibleRange = lineVisibleRanges.ranges[k];
let decorationOutput = (
'<div class="cdr '
+ className
+ '" style="left:'
+ String(visibleRange.left)
+ 'px;width:'
+ String(visibleRange.width)
+ 'px;height:'
+ lineHeight
+ 'px;"></div>'
);
output[lineIndex] += decorationOutput;
}
}
}
}