MCPcopy Index your code
hub / github.com/codeaashu/claude-code / _updateDimensions

Method _updateDimensions

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

Source from the content-addressed store, hash-verified

7139 this._model.cursor = void 0;
7140 let A = false;
7141 for (r2 = e3; r2 <= t3; r2++) for (o2 = r2 + i3.buffer.ydisp, n2 = i3.buffer.lines.get(o2), this._model.lineLengths[r2] = 0, a2 = this._characterJoinerService.getJoinedCharacters(o2), p2 = 0; p2 < i3.cols; p2++) if (s3 = this._cellColorResolver.result.bg, n2.loadCell(p2, x), 0 === p2 && (s3 = this._cellColorResolver.result.bg), h2 = false, l2 = p2, a2.length > 0 && p2 === a2[0][0] && (h2 = true, c2 = a2.shift(), x = new m(x, n2.translateToString(true, c2[0], c2[1]), c2[1] - c2[0]), l2 = c2[1] - 1), d2 = x.getChars(), _2 = x.getCode(), v2 = (r2 * i3.cols + p2) * f.RENDER_MODEL_INDICIES_PER_CELL, this._cellColorResolver.resolve(x, p2, o2, this.dimensions.device.cell.width), y && o2 === w && (p2 === M && (this._model.cursor = { x: M, y: b, width: x.getWidth(), style: this._coreBrowserService.isFocused ? i3.options.cursorStyle || "block" : i3.options.cursorInactiveStyle, cursorWidth: i3.options.cursorWidth, dpr: this._devicePixelRatio }, R = M + x.getWidth() - 1), p2 >= M && p2 <= R && (this._coreBrowserService.isFocused && "block" === (i3.options.cursorStyle || "block") || false === this._coreBrowserService.isFocused && "block" === i3.options.cursorInactiveStyle) && (this._cellColorResolver.result.fg = 50331648 | this._themeService.colors.cursorAccent.rgba >> 8 & 16777215, this._cellColorResolver.result.bg = 50331648 | this._themeService.colors.cursor.rgba >> 8 & 16777215)), _2 !== u.NULL_CELL_CODE && (this._model.lineLengths[r2] = p2 + 1), (this._model.cells[v2] !== _2 || this._model.cells[v2 + f.RENDER_MODEL_BG_OFFSET] !== this._cellColorResolver.result.bg || this._model.cells[v2 + f.RENDER_MODEL_FG_OFFSET] !== this._cellColorResolver.result.fg || this._model.cells[v2 + f.RENDER_MODEL_EXT_OFFSET] !== this._cellColorResolver.result.ext) && (A = true, d2.length > 1 && (_2 |= f.COMBINED_CHAR_BIT_MASK), this._model.cells[v2] = _2, this._model.cells[v2 + f.RENDER_MODEL_BG_OFFSET] = this._cellColorResolver.result.bg, this._model.cells[v2 + f.RENDER_MODEL_FG_OFFSET] = this._cellColorResolver.result.fg, this._model.cells[v2 + f.RENDER_MODEL_EXT_OFFSET] = this._cellColorResolver.result.ext, g2 = x.getWidth(), this._glyphRenderer.value.updateCell(p2, r2, _2, this._cellColorResolver.result.bg, this._cellColorResolver.result.fg, this._cellColorResolver.result.ext, d2, g2, s3), h2)) for (x = this._workCell, p2++; p2 < l2; p2++) C2 = (r2 * i3.cols + p2) * f.RENDER_MODEL_INDICIES_PER_CELL, this._glyphRenderer.value.updateCell(p2, r2, u.NULL_CELL_CODE, 0, 0, 0, u.NULL_CELL_CHAR, 0, 0), this._model.cells[C2] = u.NULL_CELL_CODE, this._model.cells[C2 + f.RENDER_MODEL_BG_OFFSET] = this._cellColorResolver.result.bg, this._model.cells[C2 + f.RENDER_MODEL_FG_OFFSET] = this._cellColorResolver.result.fg, this._model.cells[C2 + f.RENDER_MODEL_EXT_OFFSET] = this._cellColorResolver.result.ext;
7142 A && this._rectangleRenderer.value.updateBackgrounds(this._model), this._rectangleRenderer.value.updateCursor(this._model);
7143 }
7144 _updateDimensions() {
7145 this._charSizeService.width && this._charSizeService.height && (this.dimensions.device.char.width = Math.floor(this._charSizeService.width * this._devicePixelRatio), this.dimensions.device.char.height = Math.ceil(this._charSizeService.height * this._devicePixelRatio), this.dimensions.device.cell.height = Math.floor(this.dimensions.device.char.height * this._optionsService.rawOptions.lineHeight), this.dimensions.device.char.top = 1 === this._optionsService.rawOptions.lineHeight ? 0 : Math.round((this.dimensions.device.cell.height - this.dimensions.device.char.height) / 2), this.dimensions.device.cell.width = this.dimensions.device.char.width + Math.round(this._optionsService.rawOptions.letterSpacing), this.dimensions.device.char.left = Math.floor(this._optionsService.rawOptions.letterSpacing / 2), this.dimensions.device.canvas.height = this._terminal.rows * this.dimensions.device.cell.height, this.dimensions.device.canvas.width = this._terminal.cols * this.dimensions.device.cell.width, this.dimensions.css.canvas.height = Math.round(this.dimensions.device.canvas.height / this._devicePixelRatio), this.dimensions.css.canvas.width = Math.round(this.dimensions.device.canvas.width / this._devicePixelRatio), this.dimensions.css.cell.height = this.dimensions.device.cell.height / this._devicePixelRatio, this.dimensions.css.cell.width = this.dimensions.device.cell.width / this._devicePixelRatio);
7146 }

Callers 4

constructorMethod · 0.95
handleResizeMethod · 0.95
_handleOptionsChangedMethod · 0.95
renderRowsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected