renamed char in _char

This commit is contained in:
Asturur 2017-04-23 11:33:54 +02:00
parent bab50f4166
commit 439bf1d246
2 changed files with 8 additions and 8 deletions

View file

@ -718,11 +718,11 @@
additionalSpace = this._getWidthOfCharSpacing();
chars = _char.split('');
charWidth = 0;
for (var j = 0, len = chars.length, char; j < len; j++) {
char = chars[j];
shouldFill && ctx.fillText(char, left + charWidth, top);
shouldStroke && ctx.strokeText(char, left + charWidth, top);
_charWidth = ctx.measureText(char).width + additionalSpace;
for (var j = 0, len = chars.length, jChar; j < len; j++) {
jChar = chars[j];
shouldFill && ctx.fillText(jChar, left + charWidth, top);
shouldStroke && ctx.strokeText(jChar, left + charWidth, top);
_charWidth = ctx.measureText(jChar).width + additionalSpace;
charWidth += _charWidth > 0 ? _charWidth : 0;
}
}

View file

@ -477,7 +477,7 @@
*/
_renderChars: function(method, ctx, chars, left, top) {
// remove Text word from method var
var shortM = method.slice(0, -4), char, width;
var shortM = method.slice(0, -4), _char, width;
if (this[shortM].toLive) {
var offsetX = -this.width / 2 + this[shortM].offsetX || 0,
offsetY = -this.height / 2 + this[shortM].offsetY || 0;
@ -491,8 +491,8 @@
chars = chars.split('');
for (var i = 0, len = chars.length; i < len; i++) {
char = chars[i];
width = ctx.measureText(char).width + additionalSpace;
ctx[method](char, left, top);
width = ctx.measureText(_char).width + additionalSpace;
ctx[method](_char, left, top);
left += width > 0 ? width : 0;
}
}