mirror of
https://github.com/konvajs/konva.git
synced 2025-08-24 08:52:36 +08:00
cleaned up jshint errors in Image.js
This commit is contained in:
parent
bc11554452
commit
3c4cd6e9ed
@ -15,6 +15,7 @@
|
||||
"quotmark": "single",
|
||||
"unused": true,
|
||||
"globals": {
|
||||
"Kinetic": false
|
||||
"Kinetic": false,
|
||||
"document": false
|
||||
}
|
||||
}
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user