From 7fdc3b8d14635880b5ef0a7eeba52ca44aa3e8d3 Mon Sep 17 00:00:00 2001 From: Devon Govett Date: Mon, 17 Feb 2014 13:35:49 -0800 Subject: [PATCH] Fix for multiple continuations on the same line --- lib/line_wrapper.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/line_wrapper.coffee b/lib/line_wrapper.coffee index f78f7fc..9b67cb7 100644 --- a/lib/line_wrapper.coffee +++ b/lib/line_wrapper.coffee @@ -13,6 +13,7 @@ class LineWrapper extends EventEmitter @startY = @document.y @column = 1 @ellipsis = options.ellipsis + @continuedX = 0 # calculate the maximum Y position the text can appear at if options.height? @@ -33,7 +34,7 @@ class LineWrapper extends EventEmitter @once 'line', => @document.x -= indent @lineWidth += indent - @continuedX = null + @continuedX = 0 unless options.continued # handle left aligning last lines of paragraphs @on 'lastLine', (options) => @@ -186,7 +187,7 @@ class LineWrapper extends EventEmitter # to start the first line of the next segment at, and reset # the y position if options.continued is yes - @continuedX = textWidth + @continuedX += textWidth @document.y = y else @document.x = @startX