1
>
/*---------------------------------------------------------------------------------------------
glyphLanesModel.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { Range } from '../core/range.js';
7
>
import { GlyphMarginLane, IGlyphMarginLanesModel } from '../model.js';
8
>
9
>
10
>
const MAX_LANE = GlyphMarginLane.Right;
11
>
12
>
export class GlyphMarginLanesModel implements IGlyphMarginLanesModel {
13
>
private lanes: Uint8Array;
14
>
private persist = 0;
15
>
private _requiredLanes = 1; // always render at least one lane
16
>
17
>
constructor(maxLine: number) {
18
>
this.lanes = new Uint8Array(Math.ceil(((maxLine + 1) * MAX_LANE) / 8));
19
>
}
20
>
21
>
public reset(maxLine: number) {
22
const bytes = Math.ceil(((maxLine + 1) * MAX_LANE) / 8);
23
if (this.lanes.length < bytes) {