Lines Matching refs:lineIndex

19773     _renderTextLine: function(method, ctx, line, left, top, lineIndex) {  argument
19779 this._renderChars(method, ctx, line, left, top, lineIndex);
19783 var lineWidth = this._getLineWidth(ctx, lineIndex),
19788 wordsWidth = this._getWidthOfWords(ctx, line, lineIndex),
19795 this._renderChars(method, ctx, words[i], left + leftOffset, top, lineIndex);
19800 this._renderChars(method, ctx, line, left, top, lineIndex);
20010 _getLineWidth: function(ctx, lineIndex) { argument
20011 if (this.__lineWidths[lineIndex]) {
20012 return this.__lineWidths[lineIndex];
20014 this.__lineWidths[lineIndex] = ctx.measureText(this._textLines[lineIndex]).width;
20015 return this.__lineWidths[lineIndex];
20651 if (this.styles[loc.lineIndex]) {
20652 return this.styles[loc.lineIndex][loc.charIndex] || { };
20684 if (!this.styles[loc.lineIndex]) {
20685 this.styles[loc.lineIndex] = { };
20687 if (!this.styles[loc.lineIndex][loc.charIndex]) {
20688 this.styles[loc.lineIndex][loc.charIndex] = { };
20690 fabric.util.object.extend(this.styles[loc.lineIndex][loc.charIndex], styles);
20749 lineIndex: linesBeforeCursor.length - 1,
20760 getCurrentCharStyle: function(lineIndex, charIndex) { argument
20761 …var style = this.styles[lineIndex] && this.styles[lineIndex][charIndex === 0 ? 0 : (charIndex - 1)…
20782 getCurrentCharFontSize: function(lineIndex, charIndex) { argument
20784 this.styles[lineIndex] &&
20785 this.styles[lineIndex][charIndex === 0 ? 0 : (charIndex - 1)] &&
20786 this.styles[lineIndex][charIndex === 0 ? 0 : (charIndex - 1)].fontSize) || this.fontSize;
20795 getCurrentCharColor: function(lineIndex, charIndex) { argument
20797 this.styles[lineIndex] &&
20798 this.styles[lineIndex][charIndex === 0 ? 0 : (charIndex - 1)] &&
20799 this.styles[lineIndex][charIndex === 0 ? 0 : (charIndex - 1)].fill) || this.cursorColor;
20834 lineIndex = 0,
20842 topOffset += this._getHeightOfLine(this.ctx, lineIndex);
20844 lineIndex++;
20848 leftOffset += this._getWidthOfChar(this.ctx, chars[i], lineIndex, charIndex);
20852 lineLeftOffset = this._getCachedLineOffset(lineIndex);
20855 …topOffset += (1 - this._fontSizeFraction) * this._getHeightOfLine(this.ctx, lineIndex) / this.line…
20856 - this.getCurrentCharFontSize(lineIndex, charIndex) * (1 - this._fontSizeFraction);
20869 _getCachedLineOffset: function(lineIndex) { argument
20870 var widthOfLine = this._getLineWidth(this.ctx, lineIndex);
20872 return this.__lineOffsets[lineIndex] ||
20873 (this.__lineOffsets[lineIndex] = this._getLineLeftOffset(widthOfLine));
20884 lineIndex = cursorLocation.lineIndex,
20886 charHeight = this.getCurrentCharFontSize(lineIndex, charIndex),
20887 leftOffset = (lineIndex === 0 && charIndex === 0)
20888 ? this._getCachedLineOffset(lineIndex)
20891 ctx.fillStyle = this.getCurrentCharColor(lineIndex, charIndex);
20914 startLine = start.lineIndex,
20915 endLine = end.lineIndex;
20956 _renderChars: function(method, ctx, line, left, top, lineIndex) { argument
20972 var lineHeight = this._getHeightOfLine(ctx, lineIndex),
20973 lineLeftOffset = this._getCachedLineOffset(lineIndex),
20983 prevStyle = prevStyle || this.getCurrentCharStyle(lineIndex, i);
20984 var thisStyle = this.getCurrentCharStyle(lineIndex, i + 1);
20987 this._renderChar(method, ctx, lineIndex, i - 1, charsToRender, left, top, lineHeight);
21027 _renderChar: function(method, ctx, lineIndex, i, _char, left, top, lineHeight) { argument
21031 if (this.styles && this.styles[lineIndex] && (decl = this.styles[lineIndex][i])) {
21037 charWidth = this._applyCharStylesGetWidth(ctx, _char, lineIndex, i, decl);
21038 charHeight = this._getHeightOfChar(ctx, _char, lineIndex, i);
21059 charWidth = this._applyCharStylesGetWidth(ctx, _char, lineIndex, i);
21130 _renderTextLine: function(method, ctx, line, left, top, lineIndex) { argument
21136 this.callSuper('_renderTextLine', method, ctx, line, left, top, lineIndex);
21229 _applyCharStylesGetWidth: function(ctx, _char, lineIndex, charIndex, decl) { argument
21231 (this.styles[lineIndex] &&
21232 this.styles[lineIndex][charIndex]);
21305 _getStyleDeclaration: function(lineIndex, charIndex) { argument
21306 return (this.styles[lineIndex] && this.styles[lineIndex][charIndex])
21307 ? clone(this.styles[lineIndex][charIndex])
21315 _getWidthOfChar: function(ctx, _char, lineIndex, charIndex) { argument
21317 return this._getWidthOfSpace(ctx, lineIndex);
21320 var styleDeclaration = this._getStyleDeclaration(lineIndex, charIndex);
21329 var width = this._applyCharStylesGetWidth(ctx, _char, lineIndex, charIndex);
21339 _getHeightOfChar: function(ctx, _char, lineIndex, charIndex) { argument
21340 if (this.styles[lineIndex] && this.styles[lineIndex][charIndex]) {
21341 return this.styles[lineIndex][charIndex].fontSize || this.fontSize;
21350 _getHeightOfCharAt: function(ctx, lineIndex, charIndex) { argument
21351 var _char = this._textLines[lineIndex][charIndex];
21352 return this._getHeightOfChar(ctx, _char, lineIndex, charIndex);
21359 _getWidthOfCharsAt: function(ctx, lineIndex, charIndex) { argument
21362 _char = this._textLines[lineIndex][i];
21363 width += this._getWidthOfChar(ctx, _char, lineIndex, i);
21372 _getLineWidth: function(ctx, lineIndex) { argument
21373 if (this.__lineWidths[lineIndex]) {
21374 return this.__lineWidths[lineIndex];
21376 …this.__lineWidths[lineIndex] = this._getWidthOfCharsAt(ctx, lineIndex, this._textLines[lineIndex].…
21377 return this.__lineWidths[lineIndex];
21385 _getWidthOfSpace: function (ctx, lineIndex) { argument
21386 if (this.__widthOfSpace[lineIndex]) {
21387 return this.__widthOfSpace[lineIndex];
21389 var line = this._textLines[lineIndex],
21390 wordsWidth = this._getWidthOfWords(ctx, line, lineIndex),
21394 this.__widthOfSpace[lineIndex] = width;
21404 _getWidthOfWords: function (ctx, line, lineIndex) { argument
21411 width += this._getWidthOfChar(ctx, _char, lineIndex, charIndex);
21422 _getHeightOfLine: function(ctx, lineIndex) { argument
21423 if (this.__lineHeights[lineIndex]) {
21424 return this.__lineHeights[lineIndex];
21427 var line = this._textLines[lineIndex],
21428 maxHeight = this._getHeightOfChar(ctx, line[0], lineIndex, 0);
21431 var currentCharHeight = this._getHeightOfChar(ctx, line[i], lineIndex, i);
21436 this.__maxFontHeights[lineIndex] = maxHeight;
21437 this.__lineHeights[lineIndex] = maxHeight * this.lineHeight * this._fontSizeMult;
21438 return this.__lineHeights[lineIndex];
22065 insertNewlineStyleObject: function(lineIndex, charIndex, isEndOfLine) { argument
22067 this.shiftLineStyles(lineIndex, +1);
22069 if (!this.styles[lineIndex + 1]) {
22070 this.styles[lineIndex + 1] = { };
22073 var currentCharStyle = this.styles[lineIndex][charIndex - 1],
22080 this.styles[lineIndex + 1] = newLineStyles;
22085 for (var index in this.styles[lineIndex]) {
22087 newLineStyles[parseInt(index, 10) - charIndex] = this.styles[lineIndex][index];
22089 delete this.styles[lineIndex][index];
22092 this.styles[lineIndex + 1] = newLineStyles;
22103 insertCharStyleObject: function(lineIndex, charIndex, style) { argument
22105 var currentLineStyles = this.styles[lineIndex],
22122 this.styles[lineIndex][charIndex] =
22137 lineIndex = cursorLocation.lineIndex,
22140 if (!this.styles[lineIndex]) {
22141 this.styles[lineIndex] = { };
22145 this.insertNewlineStyleObject(lineIndex, charIndex, isEndOfLine);
22153 this.insertCharStyleObject(lineIndex, charIndex);
22165 lineIndex = cursorLocation.lineIndex,
22168 this.insertCharStyleObject(lineIndex, charIndex, styles[i]);
22177 shiftLineStyles: function(lineIndex, offset) { argument
22182 if (numericLine > lineIndex) {
22196 lineIndex = cursorLocation.lineIndex,
22201 var textOnPreviousLine = this._textLines[lineIndex - 1],
22206 if (!this.styles[lineIndex - 1]) {
22207 this.styles[lineIndex - 1] = { };
22210 for (charIndex in this.styles[lineIndex]) {
22211 this.styles[lineIndex - 1][parseInt(charIndex, 10) + newCharIndexOnPrevLine]
22212 = this.styles[lineIndex][charIndex];
22215 this.shiftLineStyles(lineIndex, -1);
22218 var currentLineStyles = this.styles[lineIndex];
22688 if (cursorLocation.lineIndex === this._textLines.length - 1 || e.metaKey || e.keyCode === 34) {
22694 var widthOfSameLineBeforeCursor = this._getLineWidth(this.ctx, cursorLocation.lineIndex);
22698 lineIndex = cursorLocation.lineIndex;
22702 widthOfCharsOnSameLineBeforeCursor += this._getWidthOfChar(this.ctx, _char, lineIndex, i);
22715 var lineIndex = cursorLocation.lineIndex + 1,
22716 widthOfNextLine = this._getLineWidth(this.ctx, lineIndex),
22725 widthOfChar = this._getWidthOfChar(this.ctx, _char, lineIndex, j);
22823 if (cursorLocation.lineIndex === 0 || e.metaKey || e.keyCode === 33) {
22831 widthOfSameLineBeforeCursor = this._getLineWidth(this.ctx, cursorLocation.lineIndex),
22834 lineIndex = cursorLocation.lineIndex;
22838 widthOfCharsOnSameLineBeforeCursor += this._getWidthOfChar(this.ctx, _char, lineIndex, i);
22852 var lineIndex = cursorLocation.lineIndex - 1,
22853 widthOfPreviousLine = this._getLineWidth(this.ctx, lineIndex),
22862 widthOfChar = this._getWidthOfChar(this.ctx, _char, lineIndex, j);
23149 …_setSVGTextLineText: function(lineIndex, textSpans, height, textLeftOffset, textTopOffset, textBgR… argument
23150 if (!this.styles[lineIndex]) {
23152 lineIndex, textSpans, height, textLeftOffset, textTopOffset);
23156 lineIndex, textSpans, height, textLeftOffset, textBgRects);
23163 _setSVGTextLineChars: function(lineIndex, textSpans, height, textLeftOffset, textBgRects) { argument
23165 var chars = this._textLines[lineIndex].split(''),
23167 lineLeftOffset = this._getSVGLineLeftOffset(lineIndex) - this.width / 2,
23168 lineOffset = this._getSVGLineTopOffset(lineIndex),
23169 heightOfLine = this._getHeightOfLine(this.ctx, lineIndex);
23172 var styleDecl = this.styles[lineIndex][i] || { };
23178 var charWidth = this._getWidthOfChar(this.ctx, chars[i], lineIndex, i);
23193 _getSVGLineLeftOffset: function(lineIndex) { argument
23194 return fabric.util.toFixed(this._getLineLeftOffset(this.__lineWidths[lineIndex]), 2);
23200 _getSVGLineTopOffset: function(lineIndex) { argument
23202 for (var j = 0; j < lineIndex; j++) {