mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-09 22:34:43 +00:00
silly formatting rules :P
This commit is contained in:
parent
b9aa3500a2
commit
a641dbf8f9
1 changed files with 6 additions and 3 deletions
|
|
@ -105,7 +105,8 @@
|
|||
|
||||
if (ctx.measureText(text).width < maxWidth) {
|
||||
lines.push(text);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
while (words.length > 0) {
|
||||
|
||||
/*
|
||||
|
|
@ -127,14 +128,16 @@
|
|||
|
||||
if (words.length > 1) {
|
||||
words[1] = tmp.slice(-1) + words[1];
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
words.push(tmp.slice(-1));
|
||||
}
|
||||
}
|
||||
|
||||
if (Math.ceil(ctx.measureText(line + words[0]).width) < maxWidth) {
|
||||
line += words.shift() + ' ';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
lines.push(line);
|
||||
line = '';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue