cleaned up jshint errors in Image.js

This commit is contained in:
Eric Rowell 2013-11-27 10:29:15 -08:00
parent bc11554452
commit 3c4cd6e9ed
2 changed files with 105 additions and 108 deletions

View File

@ -15,6 +15,7 @@
"quotmark": "single",
"unused": true,
"globals": {
"Kinetic": false
"Kinetic": false,
"document": false
}
}

View File

@ -8,10 +8,8 @@
DASH = '-',
EMPTY_STRING = '',
LEFT = 'left',
NEW_LINE = '\n',
TEXT = 'text',
TEXT_UPPER = 'Text',
TOP = 'top',
MIDDLE = 'middle',
NORMAL = 'normal',
PX_SPACE = 'px ',
@ -91,14 +89,12 @@
},
drawFunc: function(context) {
var p = this.getPadding(),
fontStyle = this.getFontStyle(),
fontSize = this.getFontSize(),
fontFamily = this.getFontFamily(),
textHeight = this.getTextHeight(),
lineHeightPx = this.getLineHeight() * textHeight,
textArr = this.textArr,
textArrLen = textArr.length,
totalWidth = this.getWidth();
totalWidth = this.getWidth(),
n;
context.setAttr('font', this._getContextFont());
context.setAttr('textBaseline', MIDDLE);
@ -108,7 +104,7 @@
context.translate(0, p + textHeight / 2);
// draw text lines
for(var n = 0; n < textArrLen; n++) {
for(n = 0; n < textArrLen; n++) {
var obj = textArr[n],
text = obj.text,
width = obj.width;
@ -202,7 +198,7 @@
_getContextFont: function() {
return this.getFontStyle() + SPACE + this.getFontSize() + PX_SPACE + this.getFontFamily();
},
_addTextLine: function (line, width, height) {
_addTextLine: function (line, width) {
return this.textArr.push({text: line, width: width});
},
_getTextWidth: function (text) {