class Prawn::Document::ColumnBox
Implements the necessary functionality to allow Document#column_box
to work.
Public Instance Methods
Source
# File lib/prawn/document/column_box.rb, line 91 def left_side absolute_left + (width_of_column * @current_column) end
x coordinate of the left edge of the current column
Source
# File lib/prawn/document/column_box.rb, line 104 def move_past_bottom @current_column = (@current_column + 1) % @columns @parent.y = @y if 0 == @current_column @parent.start_new_page end end
Moves to the next column or starts a new page if currently positioned at the rightmost column.
Source
# File lib/prawn/document/column_box.rb, line 97 def right_side columns_from_right = @columns - (1 + @current_column) absolute_right - (width_of_column * columns_from_right) end
x co-orordinate of the right edge of the current column
Source
# File lib/prawn/document/column_box.rb, line 79 def width super / @columns - @spacer end
The column width, not the width of the whole box. Used to calculate how long a line of text can be.
Calls superclass method
Prawn::Document::BoundingBox#width
Source
# File lib/prawn/document/column_box.rb, line 85 def width_of_column width + @spacer end
Column width including the spacer.