Lines Matching refs:ctx

694     drawDashedLine: function(ctx, x, y, x2, y2, da) {  argument
703 ctx.save();
704 ctx.translate(x, y);
705 ctx.moveTo(0, 0);
706 ctx.rotate(rot);
714 ctx[draw ? 'lineTo' : 'moveTo'](x, 0);
718 ctx.restore();
787 clipContext: function(receiver, ctx) { argument
788 ctx.save();
789 ctx.beginPath();
790 receiver.clipTo(ctx);
791 ctx.clip();
831 isTransparent: function(ctx, x, y, tolerance) { argument
851 imageData = ctx.getImageData(x, y, (tolerance * 2) || 1, (tolerance * 2) || 1);
989 fabric.util.drawArc = function(ctx, fx, fy, coords) { argument
1007 ctx.bezierCurveTo.apply(ctx, segs[i]);
5100 toLive: function(ctx, object) { argument
5130 gradient = ctx.createLinearGradient(
5134 gradient = ctx.createRadialGradient(
5433 toLive: function(ctx) { argument
5452 return ctx.createPattern(source, this.repeat);
5992 var ctx = this.getContext();
5994 ctx.imageSmoothingEnabled = this.imageSmoothingEnabled;
5995 ctx.webkitImageSmoothingEnabled = this.imageSmoothingEnabled;
5996 ctx.mozImageSmoothingEnabled = this.imageSmoothingEnabled;
5997 ctx.msImageSmoothingEnabled = this.imageSmoothingEnabled;
5998 ctx.oImageSmoothingEnabled = this.imageSmoothingEnabled;
6369 _draw: function (ctx, object) { argument
6374 ctx.save();
6376 ctx.transform(v[0], v[1], v[2], v[3], v[4], v[5]);
6378 object.render(ctx);
6380 ctx.restore();
6382 object._renderControls(ctx);
6427 clearContext: function(ctx) { argument
6428 ctx.clearRect(0, 0, this.width, this.height);
6510 _renderObjects: function(ctx, activeGroup) { argument
6516 this._draw(ctx, this._objects[i]);
6522 this._draw(ctx, this._objects[i]);
6533 _renderActiveGroup: function(ctx, activeGroup) { argument
6546 this._draw(ctx, activeGroup);
6554 _renderBackground: function(ctx) { argument
6556 ctx.fillStyle = this.backgroundColor.toLive
6557 ? this.backgroundColor.toLive(ctx)
6560 ctx.fillRect(
6567 this._draw(ctx, this.backgroundImage);
6575 _renderOverlay: function(ctx) { argument
6577 ctx.fillStyle = this.overlayColor.toLive
6578 ? this.overlayColor.toLive(ctx)
6581 ctx.fillRect(
6588 this._draw(ctx, this.overlayImage);
6599 var ctx = this.contextTop || this.contextContainer;
6600 this.clearContext(ctx);
6611 activeGroup.render(ctx);
6614 this._renderOverlay(ctx);
7188 var ctx = el.getContext('2d');
7189 if (!ctx) {
7196 return typeof ctx.getImageData !== 'undefined';
7199 return typeof ctx.setLineDash !== 'undefined';
7305 var ctx = this.canvas.contextTop;
7307 ctx.strokeStyle = this.color;
7308 ctx.lineWidth = this.width;
7309 ctx.lineCap = this.strokeLineCap;
7310 ctx.lineJoin = this.strokeLineJoin;
7312 ctx.setLineDash(this.strokeDashArray);
7325 var ctx = this.canvas.contextTop;
7327 ctx.shadowColor = this.shadow.color;
7328 ctx.shadowBlur = this.shadow.blur;
7329 ctx.shadowOffsetX = this.shadow.offsetX;
7330 ctx.shadowOffsetY = this.shadow.offsetY;
7338 var ctx = this.canvas.contextTop;
7340 ctx.shadowColor = '';
7341 ctx.shadowBlur = ctx.shadowOffsetX = ctx.shadowOffsetY = 0;
7443 var ctx = this.canvas.contextTop,
7448 ctx.save();
7449 ctx.transform(v[0], v[1], v[2], v[3], v[4], v[5]);
7450 ctx.beginPath();
7460 ctx.moveTo(p1.x, p1.y);
7466 ctx.quadraticCurveTo(p1.x, p1.y, midPoint.x, midPoint.y);
7474 ctx.lineTo(p1.x, p1.y);
7475 ctx.stroke();
7476 ctx.restore();
7538 var ctx = this.canvas.contextTop;
7539 ctx.closePath();
7595 ctx = this.canvas.contextTop,
7597 ctx.save();
7598 ctx.transform(v[0], v[1], v[2], v[3], v[4], v[5]);
7600 ctx.fillStyle = point.fill;
7601 ctx.beginPath();
7602 ctx.arc(point.x, point.y, point.radius, 0, Math.PI * 2, false);
7603 ctx.closePath();
7604 ctx.fill();
7606 ctx.restore();
7839 var ctx = this.canvas.contextTop;
7840 ctx.fillStyle = this.color;
7843 ctx.save();
7844 ctx.transform(v[0], v[1], v[2], v[3], v[4], v[5]);
7849 ctx.globalAlpha = point.opacity;
7851 ctx.fillRect(point.x, point.y, point.width, point.width);
7853 ctx.restore();
8627 var ctx = this.contextTop,
8634 ctx.fillStyle = this.selectionColor;
8636 ctx.fillRect(
8643 ctx.lineWidth = this.selectionLineWidth;
8644 ctx.strokeStyle = this.selectionBorderColor;
8652 ctx.beginPath();
8654 fabric.util.drawDashedLine(ctx, px, py, px + aleft, py, this.selectionDashArray);
8655 …fabric.util.drawDashedLine(ctx, px, py + atop - 1, px + aleft, py + atop - 1, this.selectionDashAr…
8656 fabric.util.drawDashedLine(ctx, px, py, px, py + atop, this.selectionDashArray);
8657 …fabric.util.drawDashedLine(ctx, px + aleft - 1, py, px + aleft - 1, py + atop, this.selectionDashA…
8659 ctx.closePath();
8660 ctx.stroke();
8663 ctx.strokeRect(
9061 drawControls: function(ctx) { argument
9064 this._drawGroupControls(ctx, activeGroup);
9067 this._drawObjectsControls(ctx);
9074 _drawGroupControls: function(ctx, activeGroup) { argument
9075 activeGroup._renderControls(ctx);
9081 _drawObjectsControls: function(ctx) { argument
9086 this._objects[i]._renderControls(ctx);
10171 ctx = this.contextTop || this.contextContainer;
10176 ctx.scale(multiplier, multiplier);
10214 ctx.scale(1 / multiplier, 1 / multiplier);
11243 transform: function(ctx, fromLeft) { argument
11245 ctx.translate(center.x, center.y);
11246 ctx.rotate(degreesToRadians(this.angle));
11247 ctx.scale(
11449 render: function(ctx, noTransform) { argument
11455 ctx.save();
11458 this._setupCompositeOperation(ctx);
11460 this.transform(ctx);
11462 this._setStrokeStyles(ctx);
11463 this._setFillStyles(ctx);
11465 ctx.transform.apply(ctx, this.transformMatrix);
11467 this._setOpacity(ctx);
11468 this._setShadow(ctx);
11469 this.clipTo && fabric.util.clipContext(this, ctx);
11470 this._render(ctx, noTransform);
11471 this.clipTo && ctx.restore();
11472 this._removeShadow(ctx);
11473 this._restoreCompositeOperation(ctx);
11475 ctx.restore();
11481 _setOpacity: function(ctx) { argument
11483 this.group._setOpacity(ctx);
11485 ctx.globalAlpha *= this.opacity;
11488 _setStrokeStyles: function(ctx) { argument
11490 ctx.lineWidth = this.strokeWidth;
11491 ctx.lineCap = this.strokeLineCap;
11492 ctx.lineJoin = this.strokeLineJoin;
11493 ctx.miterLimit = this.strokeMiterLimit;
11494 ctx.strokeStyle = this.stroke.toLive
11495 ? this.stroke.toLive(ctx, this)
11500 _setFillStyles: function(ctx) { argument
11502 ctx.fillStyle = this.fill.toLive
11503 ? this.fill.toLive(ctx, this)
11513 _renderControls: function(ctx, noTransform) { argument
11518 ctx.save();
11522 ctx.translate(center.x, center.y);
11523 ctx.rotate(degreesToRadians(this.group.angle));
11530 ctx.translate(center.x, center.y);
11531 ctx.rotate(degreesToRadians(this.angle));
11532 this.drawBorders(ctx);
11533 this.drawControls(ctx);
11534 ctx.restore();
11541 _setShadow: function(ctx) { argument
11549 ctx.shadowColor = this.shadow.color;
11550 ctx.shadowBlur = this.shadow.blur * (multX + multY) * (this.scaleX + this.scaleY) / 4;
11551 ctx.shadowOffsetX = this.shadow.offsetX * multX * this.scaleX;
11552 ctx.shadowOffsetY = this.shadow.offsetY * multY * this.scaleY;
11559 _removeShadow: function(ctx) { argument
11564 ctx.shadowColor = '';
11565 ctx.shadowBlur = ctx.shadowOffsetX = ctx.shadowOffsetY = 0;
11572 _renderFill: function(ctx) { argument
11577 ctx.save();
11580 ctx.transform.apply(ctx, g);
11583 ctx.translate(
11588 ctx.fill('evenodd');
11591 ctx.fill();
11593 ctx.restore();
11595 this._removeShadow(ctx);
11603 _renderStroke: function(ctx) { argument
11608 ctx.save();
11615 ctx.setLineDash(this.strokeDashArray);
11616 this._stroke && this._stroke(ctx);
11619 this._renderDashedStroke && this._renderDashedStroke(ctx);
11621 ctx.stroke();
11626 ctx.transform.apply(ctx, g);
11628 this._stroke ? this._stroke(ctx) : ctx.stroke();
11630 this._removeShadow(ctx);
11631 ctx.restore();
11966 _setupCompositeOperation: function (ctx) { argument
11968 this._prevGlobalCompositeOperation = ctx.globalCompositeOperation;
11969 ctx.globalCompositeOperation = this.globalCompositeOperation;
11977 _restoreCompositeOperation: function (ctx) { argument
11979 ctx.globalCompositeOperation = this._prevGlobalCompositeOperation;
13040 drawBorders: function(ctx) { argument
13045 ctx.save();
13047 ctx.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1;
13048 ctx.strokeStyle = this.borderColor;
13049 ctx.lineWidth = 1 / this.borderScaleFactor;
13059 ctx.strokeRect(
13070 ctx.beginPath();
13071 ctx.moveTo(0, rotateHeight);
13072 ctx.lineTo(0, rotateHeight - this.rotatingPointOffset);
13073 ctx.closePath();
13074 ctx.stroke();
13077 ctx.restore();
13089 drawControls: function(ctx) { argument
13102 ctx.save();
13104 ctx.lineWidth = 1;
13106 ctx.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1;
13107 ctx.strokeStyle = ctx.fillStyle = this.cornerColor;
13110 this._drawControl('tl', ctx, methodName,
13115 this._drawControl('tr', ctx, methodName,
13120 this._drawControl('bl', ctx, methodName,
13125 this._drawControl('br', ctx, methodName,
13132 this._drawControl('mt', ctx, methodName,
13137 this._drawControl('mb', ctx, methodName,
13142 this._drawControl('mr', ctx, methodName,
13147 this._drawControl('ml', ctx, methodName,
13154 this._drawControl('mtr', ctx, methodName,
13159 ctx.restore();
13167 _drawControl: function(control, ctx, methodName, left, top) { argument
13172 isVML() || this.transparentCorners || ctx.clearRect(left, top, size, size);
13173 ctx[methodName](left, top, size, size);
13626 _render: function(ctx, noTransform) { argument
13627 ctx.beginPath();
13634 ctx.translate(
13644 ctx.moveTo(p.x1, p.y1);
13645 ctx.lineTo(p.x2, p.y2);
13648 ctx.lineWidth = this.strokeWidth;
13653 var origStrokeStyle = ctx.strokeStyle;
13654 ctx.strokeStyle = this.stroke || ctx.fillStyle;
13655 this.stroke && this._renderStroke(ctx);
13656 ctx.strokeStyle = origStrokeStyle;
13663 _renderDashedStroke: function(ctx) { argument
13666 ctx.beginPath();
13667 fabric.util.drawDashedLine(ctx, p.x1, p.y1, p.x2, p.y2, this.strokeDashArray);
13668 ctx.closePath();
13952 _render: function(ctx, noTransform) { argument
13953 ctx.beginPath();
13954 ctx.arc(noTransform ? this.left + this.radius : 0,
13959 this._renderFill(ctx);
13960 this._renderStroke(ctx);
14101 _render: function(ctx) { argument
14105 ctx.beginPath();
14106 ctx.moveTo(-widthBy2, heightBy2);
14107 ctx.lineTo(0, -heightBy2);
14108 ctx.lineTo(widthBy2, heightBy2);
14109 ctx.closePath();
14111 this._renderFill(ctx);
14112 this._renderStroke(ctx);
14119 _renderDashedStroke: function(ctx) { argument
14123 ctx.beginPath();
14124 fabric.util.drawDashedLine(ctx, -widthBy2, heightBy2, 0, -heightBy2, this.strokeDashArray);
14125 fabric.util.drawDashedLine(ctx, 0, -heightBy2, widthBy2, heightBy2, this.strokeDashArray);
14126 … fabric.util.drawDashedLine(ctx, widthBy2, heightBy2, -widthBy2, heightBy2, this.strokeDashArray);
14127 ctx.closePath();
14323 _render: function(ctx, noTransform) { argument
14324 ctx.beginPath();
14325 ctx.save();
14326 ctx.transform(1, 0, 0, this.ry/this.rx, 0, 0);
14327 ctx.arc(
14334 ctx.restore();
14335 this._renderFill(ctx);
14336 this._renderStroke(ctx);
14483 _render: function(ctx, noTransform) { argument
14487 ctx.fillRect(0, 0, 1, 1);
14500 ctx.beginPath();
14502 ctx.moveTo(x + rx, y);
14504 ctx.lineTo(x + w - rx, y);
14505 isRounded && ctx.bezierCurveTo(x + w - k * rx, y, x + w, y + k * ry, x + w, y + ry);
14507 ctx.lineTo(x + w, y + h - ry);
14508 … isRounded && ctx.bezierCurveTo(x + w, y + h - k * ry, x + w - k * rx, y + h, x + w - rx, y + h);
14510 ctx.lineTo(x + rx, y + h);
14511 isRounded && ctx.bezierCurveTo(x + k * rx, y + h, x, y + h - k * ry, x, y + h - ry);
14513 ctx.lineTo(x, y + ry);
14514 isRounded && ctx.bezierCurveTo(x, y + k * ry, x + k * rx, y, x + rx, y);
14516 ctx.closePath();
14518 this._renderFill(ctx);
14519 this._renderStroke(ctx);
14526 _renderDashedStroke: function(ctx) { argument
14532 ctx.beginPath();
14533 fabric.util.drawDashedLine(ctx, x, y, x + w, y, this.strokeDashArray);
14534 fabric.util.drawDashedLine(ctx, x + w, y, x + w, y + h, this.strokeDashArray);
14535 fabric.util.drawDashedLine(ctx, x + w, y + h, x, y + h, this.strokeDashArray);
14536 fabric.util.drawDashedLine(ctx, x, y + h, x, y, this.strokeDashArray);
14537 ctx.closePath();
14747 _render: function(ctx) { argument
14748 if (!fabric.Polygon.prototype.commonRender.call(this, ctx)) {
14751 this._renderFill(ctx);
14752 this._renderStroke(ctx);
14759 _renderDashedStroke: function(ctx) { argument
14762 ctx.beginPath();
14766 fabric.util.drawDashedLine(ctx, p1.x, p1.y, p2.x, p2.y, this.strokeDashArray);
14966 _render: function(ctx) { argument
14967 if (!this.commonRender(ctx)) {
14970 this._renderFill(ctx);
14972 ctx.closePath();
14973 this._renderStroke(ctx);
14981 commonRender: function(ctx) { argument
14990 ctx.beginPath();
14999 ctx.moveTo(this.points[0].x, this.points[0].y);
15002 ctx.lineTo(point.x, point.y);
15011 _renderDashedStroke: function(ctx) { argument
15012 fabric.Polyline.prototype._renderDashedStroke.call(this, ctx); argument
15013 ctx.closePath();
15211 _render: function(ctx) { argument
15230 ctx.beginPath();
15241 ctx.lineTo(x + l, y + t);
15247 ctx.lineTo(x + l, y + t);
15252 ctx.lineTo(x + l, y + t);
15257 ctx.lineTo(x + l, y + t);
15262 ctx.lineTo(x + l, y + t);
15267 ctx.lineTo(x + l, y + t);
15275 ctx.moveTo(x + l, y + t);
15283 ctx.moveTo(x + l, y + t);
15291 ctx.bezierCurveTo(
15308 ctx.bezierCurveTo(
15336 ctx.bezierCurveTo(
15369 ctx.bezierCurveTo(
15397 ctx.quadraticCurveTo(
15411 ctx.quadraticCurveTo(
15441 ctx.quadraticCurveTo(
15467 ctx.quadraticCurveTo(
15479 drawArc(ctx, x + l, y + t, [
15494 drawArc(ctx, x + l, y + t, [
15511 ctx.closePath();
15516 this._renderFill(ctx);
15517 this._renderStroke(ctx);
16134 render: function(ctx) { argument
16140 ctx.save();
16143 ctx.transform.apply(ctx, this.transformMatrix);
16145 this.transform(ctx);
16147 this._setShadow(ctx);
16148 this.clipTo && fabric.util.clipContext(this, ctx);
16149 ctx.translate(-this.width/2, -this.height/2);
16151 this.paths[i].render(ctx, true);
16153 this.clipTo && ctx.restore();
16154 this._removeShadow(ctx);
16155 ctx.restore();
16531 render: function(ctx) { argument
16537 ctx.save();
16538 this.clipTo && fabric.util.clipContext(this, ctx);
16539 this.transform(ctx);
16542 this._renderObject(this._objects[i], ctx);
16545 this.clipTo && ctx.restore();
16547 ctx.restore();
16555 _renderControls: function(ctx, noTransform) { argument
16556 this.callSuper('_renderControls', ctx, noTransform);
16558 this._objects[i]._renderControls(ctx);
16565 _renderObject: function(object, ctx) { argument
16575 object.render(ctx);
17042 _stroke: function(ctx) { argument
17043 ctx.save();
17044 this._setStrokeStyles(ctx);
17045 ctx.beginPath();
17046 ctx.strokeRect(-this.width / 2, -this.height / 2, this.width, this.height);
17047 ctx.closePath();
17048 ctx.restore();
17055 _renderDashedStroke: function(ctx) { argument
17061 ctx.save();
17062 this._setStrokeStyles(ctx);
17064 ctx.beginPath();
17065 fabric.util.drawDashedLine(ctx, x, y, x + w, y, this.strokeDashArray);
17066 fabric.util.drawDashedLine(ctx, x + w, y, x + w, y + h, this.strokeDashArray);
17067 fabric.util.drawDashedLine(ctx, x + w, y + h, x, y + h, this.strokeDashArray);
17068 fabric.util.drawDashedLine(ctx, x, y + h, x, y, this.strokeDashArray);
17069 ctx.closePath();
17070 ctx.restore();
17245 _render: function(ctx, noTransform) { argument
17252 ctx.beginPath();
17253 ctx.rect(x, y, this.width, this.height);
17254 ctx.clip();
17265 elementToDraw && ctx.drawImage(elementToDraw,
17272 this._renderStroke(ctx);
19646 _initDimensions: function(ctx) { argument
19650 if (!ctx) {
19651 ctx = fabric.util.createCanvasElement().getContext('2d');
19652 this._setTextStyles(ctx);
19658 this.width = this._getTextWidth(ctx);
19660 this.height = this._getTextHeight(ctx);
19676 _render: function(ctx) { argument
19678 this.clipTo && fabric.util.clipContext(this, ctx);
19680 this._renderTextBackground(ctx);
19681 this._renderText(ctx);
19683 this._renderTextDecoration(ctx);
19684 this.clipTo && ctx.restore();
19691 _renderText: function(ctx) { argument
19692 ctx.save();
19693 this._translateForTextAlign(ctx);
19694 this._setOpacity(ctx);
19695 this._setShadow(ctx);
19696 this._setupCompositeOperation(ctx);
19697 this._renderTextFill(ctx);
19698 this._renderTextStroke(ctx);
19699 this._restoreCompositeOperation(ctx);
19700 this._removeShadow(ctx);
19701 ctx.restore();
19708 _translateForTextAlign: function(ctx) { argument
19710 ctx.translate(this.textAlign === 'center' ? (this.width / 2) : this.width, 0);
19718 _setTextStyles: function(ctx) { argument
19719 ctx.textBaseline = 'alphabetic';
19721 ctx.textAlign = this.textAlign;
19723 ctx.font = this._getFontDeclaration();
19740 _getTextWidth: function(ctx) { argument
19741 var maxWidth = this._getLineWidth(ctx, 0);
19744 var currentLineWidth = this._getLineWidth(ctx, i);
19760 _renderChars: function(method, ctx, chars, left, top) { argument
19761 ctx[method](chars, left, top);
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);
19796 leftOffset += ctx.measureText(words[i]).width + spaceWidth;
19800 this._renderChars(method, ctx, line, left, top, lineIndex);
19809 _getWidthOfWords: function (ctx, line) { argument
19810 return ctx.measureText(line.replace(/\s+/g, '')).width;
19833 _renderTextFill: function(ctx) { argument
19841 var heightOfLine = this._getHeightOfLine(ctx, i),
19846 ctx,
19855 this._removeShadow(ctx);
19863 _renderTextStroke: function(ctx) { argument
19870 ctx.save();
19877 supportsLineDash && ctx.setLineDash(this.strokeDashArray);
19880 ctx.beginPath();
19882 var heightOfLine = this._getHeightOfLine(ctx, i),
19887 ctx,
19895 ctx.closePath();
19896 ctx.restore();
19908 _renderTextBackground: function(ctx) { argument
19909 this._renderTextBoxBackground(ctx);
19910 this._renderTextLinesBackground(ctx);
19917 _renderTextBoxBackground: function(ctx) { argument
19922 ctx.save();
19923 ctx.fillStyle = this.backgroundColor;
19925 ctx.fillRect(
19932 ctx.restore();
19939 _renderTextLinesBackground: function(ctx) { argument
19945 ctx.save();
19946 ctx.fillStyle = this.textBackgroundColor;
19952 var lineWidth = this._getLineWidth(ctx, i),
19955 ctx.fillRect(
19964 ctx.restore();
20010 _getLineWidth: function(ctx, lineIndex) { argument
20014 this.__lineWidths[lineIndex] = ctx.measureText(this._textLines[lineIndex]).width;
20022 _renderTextDecoration: function(ctx) { argument
20035 var lineWidth = _this._getLineWidth(ctx, i),
20037 heightOfLine = _this._getHeightOfLine(ctx, i);
20040 ctx.fillRect(
20082 render: function(ctx, noTransform) { argument
20088 ctx.save();
20089 this._setTextStyles(ctx);
20092 this._initDimensions(ctx);
20095 this.transform(ctx);
20097 this._setStrokeStyles(ctx);
20098 this._setFillStyles(ctx);
20100 ctx.transform.apply(ctx, this.transformMatrix);
20103 ctx.translate(this.left, this.top);
20105 this._render(ctx);
20106 ctx.restore();
20140 offsets = this._getSVGLeftTopOffsets(this.ctx),
20150 _getSVGLeftTopOffsets: function(ctx) { argument
20151 var lineTop = this._getHeightOfLine(ctx, 0),
20201 height += this._getHeightOfLine(this.ctx, i);
20238 toFixed(this._getHeightOfLine(this.ctx, i) / this.lineHeight, 4),
20697 _render: function(ctx) { argument
20698 this.callSuper('_render', ctx);
20699 this.ctx = ctx;
20712 boundaries, ctx;
20715 ctx = this.canvas.contextTop;
20716 ctx.save();
20717 ctx.transform.apply(ctx, this.canvas.viewportTransform);
20718 this.transform(ctx);
20721 ctx = this.ctx;
20722 ctx.save();
20727 this.renderCursor(boundaries, ctx);
20731 this.renderSelection(chars, boundaries, ctx);
20734 ctx.restore();
20842 topOffset += this._getHeightOfLine(this.ctx, lineIndex);
20848 leftOffset += this._getWidthOfChar(this.ctx, chars[i], lineIndex, charIndex);
20855 …topOffset += (1 - this._fontSizeFraction) * this._getHeightOfLine(this.ctx, lineIndex) / this.line…
20870 var widthOfLine = this._getLineWidth(this.ctx, lineIndex);
20881 renderCursor: function(boundaries, ctx) { argument
20891 ctx.fillStyle = this.getCurrentCharColor(lineIndex, charIndex);
20892 ctx.globalAlpha = this.__isMousedown ? 1 : this._currentCursorOpacity;
20894 ctx.fillRect(
20908 renderSelection: function(chars, boundaries, ctx) { argument
20910 ctx.fillStyle = this.selectionColor;
20919 lineHeight = this._getHeightOfLine(this.ctx, i),
20925 boxWidth += this._getWidthOfChar(ctx, line[j], i, j);
20928 lineOffset += this._getWidthOfChar(ctx, line[j], i, j);
20933 boxWidth += this._getLineWidth(ctx, i) || 5;
20937 boxWidth += this._getWidthOfChar(ctx, line[j2], i, j2);
20941 ctx.fillRect(
20956 _renderChars: function(method, ctx, line, left, top, lineIndex) { argument
20959 return this._renderCharsFast(method, ctx, line, left, top);
20972 var lineHeight = this._getHeightOfLine(ctx, lineIndex),
20980 ctx.save();
20987 this._renderChar(method, ctx, lineIndex, i - 1, charsToRender, left, top, lineHeight);
20994 ctx.restore();
21005 _renderCharsFast: function(method, ctx, line, left, top) { argument
21009 this.callSuper('_renderChars', method, ctx, line, left, top);
21012 this.callSuper('_renderChars', method, ctx, line, left, top);
21027 _renderChar: function(method, ctx, lineIndex, i, _char, left, top, lineHeight) { argument
21036 ctx.save();
21037 charWidth = this._applyCharStylesGetWidth(ctx, _char, lineIndex, i, decl);
21038 charHeight = this._getHeightOfChar(ctx, _char, lineIndex, i);
21041 ctx.fillText(_char, left, top);
21044 ctx.strokeText(_char, left, top);
21047 this._renderCharDecoration(ctx, decl, left, top, offset, charWidth, charHeight);
21048 ctx.restore();
21050 ctx.translate(charWidth, 0);
21054 ctx[method](_char, left, top);
21057 ctx[method](_char, left, top);
21059 charWidth = this._applyCharStylesGetWidth(ctx, _char, lineIndex, i);
21060 this._renderCharDecoration(ctx, null, left, top, offset, charWidth, this.fontSize);
21062 ctx.translate(ctx.measureText(_char).width, 0);
21088 … _renderCharDecoration: function(ctx, styleDeclaration, left, top, offset, charWidth, charHeight) { argument
21099 ctx.fillRect(
21107 ctx.fillRect(
21115 ctx.fillRect(
21130 _renderTextLine: function(method, ctx, line, left, top, lineIndex) { argument
21136 this.callSuper('_renderTextLine', method, ctx, line, left, top, lineIndex);
21143 _renderTextDecoration: function(ctx) { argument
21145 return this.callSuper('_renderTextDecoration', ctx);
21153 _renderTextLinesBackground: function(ctx) { argument
21158 ctx.save();
21161 ctx.fillStyle = this.textBackgroundColor;
21168 var heightOfLine = this._getHeightOfLine(ctx, i);
21174 var lineWidth = this._getLineWidth(ctx, i),
21178 ctx.fillStyle = this.textBackgroundColor;
21180 ctx.fillRect(
21193 ctx.fillStyle = this.styles[i][j].textBackgroundColor;
21195 ctx.fillRect(
21196 this._getLeftOffset() + lineLeftOffset + this._getWidthOfCharsAt(ctx, i, j),
21198 this._getWidthOfChar(ctx, _char, i, j) + 1,
21206 ctx.restore();
21229 _applyCharStylesGetWidth: function(ctx, _char, lineIndex, charIndex, decl) { argument
21256 ctx.fillStyle = fill.toLive
21257 ? fill.toLive(ctx, this)
21261 ctx.strokeStyle = (styleDeclaration.stroke && styleDeclaration.stroke.toLive)
21262 ? styleDeclaration.stroke.toLive(ctx, this)
21266 ctx.lineWidth = styleDeclaration.strokeWidth || this.strokeWidth;
21267 ctx.font = this._getFontDeclaration.call(styleDeclaration);
21268 this._setShadow.call(styleDeclaration, ctx);
21271 return ctx.measureText(_char).width;
21275 this._charWidthsCache[cacheProp] = ctx.measureText(_char).width;
21315 _getWidthOfChar: function(ctx, _char, lineIndex, charIndex) { argument
21317 return this._getWidthOfSpace(ctx, lineIndex);
21327 else if (ctx) {
21328 ctx.save();
21329 var width = this._applyCharStylesGetWidth(ctx, _char, lineIndex, charIndex);
21330 ctx.restore();
21339 _getHeightOfChar: function(ctx, _char, lineIndex, charIndex) { argument
21350 _getHeightOfCharAt: function(ctx, lineIndex, charIndex) { argument
21352 return this._getHeightOfChar(ctx, _char, lineIndex, charIndex);
21359 _getWidthOfCharsAt: function(ctx, lineIndex, charIndex) { argument
21363 width += this._getWidthOfChar(ctx, _char, lineIndex, i);
21372 _getLineWidth: function(ctx, lineIndex) { argument
21376 …this.__lineWidths[lineIndex] = this._getWidthOfCharsAt(ctx, lineIndex, this._textLines[lineIndex].…
21385 _getWidthOfSpace: function (ctx, lineIndex) { argument
21390 wordsWidth = this._getWidthOfWords(ctx, line, lineIndex),
21404 _getWidthOfWords: function (ctx, line, lineIndex) { argument
21411 width += this._getWidthOfChar(ctx, _char, lineIndex, charIndex);
21422 _getHeightOfLine: function(ctx, lineIndex) { argument
21428 maxHeight = this._getHeightOfChar(ctx, line[0], lineIndex, 0);
21431 var currentCharHeight = this._getHeightOfChar(ctx, line[i], lineIndex, i);
21445 _getTextHeight: function(ctx) { argument
21448 height += this._getHeightOfLine(ctx, i);
21457 _renderTextBoxBackground: function(ctx) { argument
21462 ctx.save();
21463 ctx.fillStyle = this.backgroundColor;
21465 ctx.fillRect(
21472 ctx.restore();
21617 obj.canvas.clearContext(obj.canvas.contextTop || obj.ctx);
21655 this.canvas.clearContext(this.canvas.contextTop || this.ctx);
21677 this.canvas && this.canvas.clearContext(this.canvas.contextTop || this.ctx);
22440 height += this._getHeightOfLine(this.ctx, i) * this.scaleY;
22442 var widthOfLine = this._getLineWidth(this.ctx, i),
22457 width += this._getWidthOfChar(this.ctx, _char, i, this.flipX ? jlen - j : j) *
22694 var widthOfSameLineBeforeCursor = this._getLineWidth(this.ctx, cursorLocation.lineIndex);
22702 widthOfCharsOnSameLineBeforeCursor += this._getWidthOfChar(this.ctx, _char, lineIndex, i);
22716 widthOfNextLine = this._getLineWidth(this.ctx, lineIndex),
22725 widthOfChar = this._getWidthOfChar(this.ctx, _char, lineIndex, j);
22831 widthOfSameLineBeforeCursor = this._getLineWidth(this.ctx, cursorLocation.lineIndex),
22838 widthOfCharsOnSameLineBeforeCursor += this._getWidthOfChar(this.ctx, _char, lineIndex, i);
22853 widthOfPreviousLine = this._getLineWidth(this.ctx, lineIndex),
22862 widthOfChar = this._getWidthOfChar(this.ctx, _char, lineIndex, j);
23169 heightOfLine = this._getHeightOfLine(this.ctx, lineIndex);
23178 var charWidth = this._getWidthOfChar(this.ctx, chars[i], lineIndex, i);
23203 lineTopOffset += this._getHeightOfLine(this.ctx, j);
23205 lastHeight = this._getHeightOfLine(this.ctx, j);