mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
Call emitLine() only once
emitLine() was called twice in some cases
This commit is contained in:
parent
a944efdac5
commit
e02f69ac00
@ -155,6 +155,11 @@ class LineWrapper extends EventEmitter
|
||||
|
||||
buffer = buffer + @ellipsis
|
||||
|
||||
if bk.required and w > @spaceLeft
|
||||
buffer = word;
|
||||
textWidth = w;
|
||||
wc = 1;
|
||||
|
||||
emitLine()
|
||||
|
||||
# if we've reached the edge of the page,
|
||||
@ -170,13 +175,6 @@ class LineWrapper extends EventEmitter
|
||||
|
||||
# reset the space left and buffer
|
||||
if bk.required
|
||||
# if there's a word but no space left, emit single line
|
||||
if w > @spaceLeft
|
||||
buffer = word
|
||||
textWidth = w
|
||||
wc = 1
|
||||
emitLine()
|
||||
|
||||
@spaceLeft = @lineWidth
|
||||
buffer = ''
|
||||
textWidth = 0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user