mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-10 14:54:42 +00:00
Avoid width=0 for text objects
This commit is contained in:
parent
476da71e92
commit
f6a6ea68b7
1 changed files with 1 additions and 1 deletions
|
|
@ -463,7 +463,7 @@
|
|||
* @return {Number} Maximum width of fabric.Text object
|
||||
*/
|
||||
_getTextWidth: function(ctx, textLines) {
|
||||
var maxWidth = ctx.measureText(textLines[0]).width;
|
||||
var maxWidth = ctx.measureText(textLines[0] || '|').width;
|
||||
|
||||
for (var i = 1, len = textLines.length; i < len; i++) {
|
||||
var currentLineWidth = ctx.measureText(textLines[i]).width;
|
||||
|
|
|
|||
Loading…
Reference in a new issue