-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Work for #3275 #3298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Work for #3275 #3298
Conversation
src/modules/acroform.js
Outdated
var lastLine = ""; | ||
var lineCount = 0; | ||
Line: for (var i in textSplit) { | ||
Line: for (let i = 0; i < textSplit.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change let to var. Potentially breaking old JavaScript Engines.
src/modules/acroform.js
Outdated
|
||
for (var x = firstWordInLine; x <= lastWordInLine; x++) { | ||
line += textSplit[x] + " "; | ||
const currLine = textSplit[x]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change const to var
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually no longer necessary. I've added Babel to the deployment, so you can use modern JS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Please add another test case with longer lines (so the font size gets smaller).
if (formObject.multiline) { | ||
textSplit = textSplit.map(word => word.split("\n")); | ||
} else { | ||
textSplit = textSplit.map(word => [word]); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this looks a bit fishy to me. Does this work for a text like "abc \n def"? Wouldn't it be better to split first into lines and then into words?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, then we'll keep it this way. Thanks for adding the new test. I'll merge it now.
Awesome pull request guys, thank you all |
We've fixed this bug