Skip to content

Commit

Permalink
move column_box method override to Prawn extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Jun 8, 2022
1 parent 63c9374 commit 659d7d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 0 additions & 8 deletions lib/asciidoctor/pdf/ext/prawn/document/column_box.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# frozen_string_literal: true

Prawn::Document.prepend (Module.new do
# Wraps the column_box method and automatically sets the height unless the :height option is specified.
def column_box point, options, &block
options[:height] = cursor unless options.key? :height
super
end
end)

Prawn::Document::ColumnBox.prepend (Module.new do
attr_accessor :current_column

Expand Down
6 changes: 6 additions & 0 deletions lib/asciidoctor/pdf/ext/prawn/extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,12 @@ def span_page_width_if verdict
end
end

# Wraps the column_box method and automatically sets the height unless the :height option is specified.
def column_box point, options, &block
options[:height] = cursor unless options.key? :height
super
end

# A flowing version of bounding_box. If the content runs to another page, the cursor starts at
# the top of the page instead of from the original cursor position. Similar to span, except
# the :position option is limited to a numeric value and additional options are passed through
Expand Down

0 comments on commit 659d7d3

Please sign in to comment.