Skip to content

Commit

Permalink
checking graphic_state of previous page exists before duping while cr…
Browse files Browse the repository at this point in the history
…eating new page
  • Loading branch information
aayushkhandelwal11 committed May 2, 2013
1 parent 1f8b6c1 commit c5dbf35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/prawn/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ def start_new_page(options = {})
:layout => options[:layout] || last_page_layout,
:margins => last_page_margins}
if last_page
new_graphic_state = last_page.graphic_state.dup
new_graphic_state = last_page.graphic_state.dup if last_page.graphic_state.present?
#erase the color space so that it gets reset on new page for fussy pdf-readers
new_graphic_state.color_space = {}
new_graphic_state.color_space = {} if new_graphic_state
page_options.merge!(:graphic_state => new_graphic_state)
end
merge_template_options(page_options, options) if options[:template]
Expand Down

0 comments on commit c5dbf35

Please sign in to comment.