File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -86,9 +86,9 @@ class LineWrapper extends EventEmitter {
86
86
87
87
canFit ( word , w ) {
88
88
if ( word [ word . length - 1 ] != SOFT_HYPHEN ) {
89
- return w <= this . spaceLeft ;
89
+ return PDFNumber ( w ) <= PDFNumber ( this . spaceLeft ) ;
90
90
}
91
- return w + this . wordWidth ( HYPHEN ) <= this . spaceLeft ;
91
+ return PDFNumber ( w + this . wordWidth ( HYPHEN ) ) <= PDFNumber ( this . spaceLeft ) ;
92
92
}
93
93
94
94
eachWord ( text , fn ) {
@@ -119,7 +119,7 @@ class LineWrapper extends EventEmitter {
119
119
while ( word . length ) {
120
120
// fit as much of the word as possible into the space we have
121
121
var l , mightGrow ;
122
- if ( w > this . spaceLeft ) {
122
+ if ( PDFNumber ( w ) > PDFNumber ( this . spaceLeft ) ) {
123
123
// start our check at the end of our available space - this method is faster than a loop of each character and it resolves
124
124
// an issue with long loops when processing massive words, such as a huge number of spaces
125
125
l = Math . ceil ( this . spaceLeft / ( w / word . length ) ) ;
You can’t perform that action at this time.
0 commit comments