MCPcopy Create free account
hub / github.com/codeaashu/claude-code / clear

Method clear

src/server/web/public/terminal.js:6877–6884  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6875 this._updateCell(this._vertices.attributes, e3, t3, i3, s3, r2, o2, n2, a2, h2);
6876 }
6877 _updateCell(e3, t3, i3, r2, n2, a2, l2, g2, v, f) {
6878 d = (i3 * this._terminal.cols + t3) * h, r2 !== o.NULL_CELL_CODE && void 0 !== r2 ? this._atlas && (c = g2 && g2.length > 1 ? this._atlas.getRasterizedGlyphCombinedChar(g2, n2, a2, l2, false) : this._atlas.getRasterizedGlyph(r2, n2, a2, l2, false), _ = Math.floor((this._dimensions.device.cell.width - this._dimensions.device.char.width) / 2), n2 !== f && c.offset.x > _ ? (u = c.offset.x - _, e3[d] = -(c.offset.x - u) + this._dimensions.device.char.left, e3[d + 1] = -c.offset.y + this._dimensions.device.char.top, e3[d + 2] = (c.size.x - u) / this._dimensions.device.canvas.width, e3[d + 3] = c.size.y / this._dimensions.device.canvas.height, e3[d + 4] = c.texturePage, e3[d + 5] = c.texturePositionClipSpace.x + u / this._atlas.pages[c.texturePage].canvas.width, e3[d + 6] = c.texturePositionClipSpace.y, e3[d + 7] = c.sizeClipSpace.x - u / this._atlas.pages[c.texturePage].canvas.width, e3[d + 8] = c.sizeClipSpace.y) : (e3[d] = -c.offset.x + this._dimensions.device.char.left, e3[d + 1] = -c.offset.y + this._dimensions.device.char.top, e3[d + 2] = c.size.x / this._dimensions.device.canvas.width, e3[d + 3] = c.size.y / this._dimensions.device.canvas.height, e3[d + 4] = c.texturePage, e3[d + 5] = c.texturePositionClipSpace.x, e3[d + 6] = c.texturePositionClipSpace.y, e3[d + 7] = c.sizeClipSpace.x, e3[d + 8] = c.sizeClipSpace.y), this._optionsService.rawOptions.rescaleOverlappingGlyphs && (0, s2.allowRescaling)(r2, v, c.size.x, this._dimensions.device.cell.width) && (e3[d + 2] = (this._dimensions.device.cell.width - 1) / this._dimensions.device.canvas.width)) : e3.fill(0, d, d + h - 1 - 2);
6879 }
6880 clear() {
6881 const e3 = this._terminal, t3 = e3.cols * e3.rows * h;
6882 this._vertices.count !== t3 ? this._vertices.attributes = new Float32Array(t3) : this._vertices.attributes.fill(0);
6883 let i3 = 0;
6884 for (; i3 < this._vertices.attributesBuffers.length; i3++) this._vertices.count !== t3 ? this._vertices.attributesBuffers[i3] = new Float32Array(t3) : this._vertices.attributesBuffers[i3].fill(0);
6885 this._vertices.count = t3, i3 = 0;
6886 for (let t4 = 0; t4 < e3.rows; t4++) for (let s3 = 0; s3 < e3.cols; s3++) this._vertices.attributes[i3 + 9] = s3 / e3.cols, this._vertices.attributes[i3 + 10] = t4 / e3.rows, i3 += h;
6887 }

Callers 1

handleResizeMethod · 0.95

Calls 1

fillMethod · 0.80

Tested by

no test coverage detected