problem with some texts
I'm getting error at this line, that there is no pop function:
if (actualsize === 0) lines[actualline].pop();
I don't understand what the code does, but from quick glance I guess it should be:
if (actualsize === 0) lines[actualline].Words.pop();
Also in this part of code, it get into never-ending loop. I am also not sure what is happening, so you might check it..
if (actualsize === 0) {...}
else {
if (actualsize + sp + wo.l > w)
{
// THIS IF BRANCH IS MISSING i++, so the cycle never ends!
}
else {...}
}
I don't know if those are good fixes. But they do prevent crashing my app.
The problem appears when some long text has width just 50px (i'm importing text layers from photoshop, this one had broken boundary size).
Hello Psycho.
I just pushed a new version with some comments in the code and a bug fixed.
Concretely, You are right in the firts comment, but to fix it, the line should be:
if (actualsize === 0) lines.pop();
For the second comment, it will not go to infinite loop. What I do here is create a new line and do not incremet i. (This word that does not fit in this line will be inserted in the next line.
Please, let me know if it works good. If not, please send me some use example so I can debug it.
Thank you,
Jordi Baylina.
2013/11/13 Psycho Brm [email protected]
I'm getting error at this line, that there is no pop function:
if (actualsize === 0) lines[actualline].pop();
I don't understand what the code does, but from quick glance I guess it should be:
if (actualsize === 0) lines[actualline].Words.pop();
Also in this part of code, it get into never-ending loop. I am also not sure what is happening, so you might check it..
if (actualsize === 0) {...} else { if (actualsize + sp + wo.l > w) { // THIS IF BRANCH IS MISSING i++, so the cycle never ends! } else {...} }
I don't know if those are good fixes. But they do prevent crashing my app.
The problem appears when some long text has width just 50px (i'm importing text layers from photoshop, this one had broken boundary size).
— Reply to this email directly or view it on GitHubhttps://github.com/jbaylina/jsTifier/issues/2 .