Save the fill color and restore it after the line wrapper makes a new page

This commit is contained in:
Devon Govett 2014-02-16 11:50:59 -08:00
parent df43e0eeb0
commit 4b3d2c9e30
2 changed files with 6 additions and 1 deletions

View File

@ -116,7 +116,8 @@ class LineWrapper extends EventEmitter
@column = 1
@startY = @document.page.margins.top
@maxY = @document.page.maxY()
@document.x = x
@document.x = x
@document.fillColor @document._fillColor... if @document._fillColor
@emit 'pageBreak', options, this
else

View File

@ -68,6 +68,10 @@ module.exports =
fillColor: (color, opacity = 1) ->
set = @_setColor color, no
@fillOpacity opacity if set
# save this for text wrapper, which needs to reset
# the fill color on new pages
@_fillColor = [color, opacity]
return this
strokeColor: (color, opacity = 1) ->