mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-14 00:33:09 +00:00
Update text.class.js
This commit is contained in:
parent
213241a5fc
commit
f15b7f5d3c
1 changed files with 9 additions and 3 deletions
|
|
@ -624,7 +624,9 @@
|
|||
this.width,
|
||||
this.height
|
||||
);
|
||||
|
||||
// if there is background color no other shadows
|
||||
// should be casted
|
||||
this._removeShadow(ctx);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -635,11 +637,12 @@
|
|||
if (!this.textBackgroundColor) {
|
||||
return;
|
||||
}
|
||||
var lineTopOffset = 0, heightOfLine = this._getHeightOfLine(),
|
||||
var lineTopOffset = 0, heightOfLine,
|
||||
lineWidth, lineLeftOffset;
|
||||
|
||||
ctx.fillStyle = this.textBackgroundColor;
|
||||
for (var i = 0, len = this._textLines.length; i < len; i++) {
|
||||
heightOfLine = this._getHeightOfLine(ctx, i);
|
||||
if (this._textLines[i] !== '') {
|
||||
lineWidth = this.textAlign === 'justify' ? this.width : this._getLineWidth(ctx, i);
|
||||
lineLeftOffset = this._getLineLeftOffset(lineWidth);
|
||||
|
|
@ -647,11 +650,14 @@
|
|||
this._getLeftOffset() + lineLeftOffset,
|
||||
this._getTopOffset() + lineTopOffset,
|
||||
lineWidth,
|
||||
this.fontSize * this._fontSizeMult
|
||||
heightOfLine / this.lineHeight
|
||||
);
|
||||
}
|
||||
lineTopOffset += heightOfLine;
|
||||
}
|
||||
// if there is text background color no
|
||||
// other shadows should be casted
|
||||
this._removeShadow(ctx);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue