### Home Classes Methods

### In Files

- lib/prawn/document/column_box.rb

### Parent

BoundingBox

### Methods

- #add_left_padding
- #add_right_padding
- #bare_column_width
- #left
- #left_side
- #move_past_bottom
- #right
- #right_side
- #subtract_left_padding
- #subtract_right_padding
- #width
- #width_of_column

### Class/Module Index

Quicksearch

- Prawn
- Prawn::Configurable
- Prawn::Document
- Prawn::Document::BoundingBox
- Prawn::Document::ColumnBox
- Prawn::Document::GraphicsState
- Prawn::Document::Grid
- Prawn::Document::GridBox
- Prawn::Document::Internals
- Prawn::Document::Security
- Prawn::Document::Snapshot
- Prawn::Encoding
- Prawn::Errors
- Prawn::Font
- Prawn::Font::AFM
- Prawn::Font::DFont
- Prawn::Font::TTF
- Prawn::FontMetricCache
- Prawn::Graphics
- Prawn::Graphics::CapStyle
- Prawn::Graphics::Color
- Prawn::Graphics::Dash
- Prawn::Graphics::JoinStyle
- Prawn::Graphics::Patterns
- Prawn::Graphics::Transformation
- Prawn::Graphics::Transparency
- Prawn::ImageHandler
- Prawn::Images
- Prawn::Images::Image
- Prawn::Images::JPG
- Prawn::Images::PNG
- Prawn::Measurements
- Prawn::SoftMask
- Prawn::Stamp
- Prawn::SynchronizedCache
- Prawn::Table
- Prawn::Table::Cell
- Prawn::Table::Cell::Image
- Prawn::Table::Cell::InTable
- Prawn::Table::Cell::SpanDummy
- Prawn::Table::Cell::Subtable
- Prawn::Table::Cell::Text
- Prawn::Table::Cells
- Prawn::Table::ColumnWidthCalculator
- Prawn::Text
- Prawn::Text::Box
- Prawn::Text::Formatted
- Prawn::Text::Formatted::Box
- Prawn::Text::Formatted::Fragment
- Prawn::Text::Formatted::Parser
- Prawn::ThreadLocalCache
- PDF
- PDF::Core
- PDF::Core::Reference
- PDF::Core::Stream
- Arcfour
- Numeric

No matching classes.

# Prawn::Document::ColumnBox

Implements the necessary functionality to allow Document#column_box to work.

### Public Instance Methods

add_left_padding(left_padding) click to toggle source

Override the padding functions so as not to split the padding amount between all columns on the page.

    # File lib/prawn/document/column_box.rb, line 122
    def add_left_padding(left_padding)
      @total_left_padding += left_padding
      @x += left_padding
    end

add_right_padding(right_padding) click to toggle source

    # File lib/prawn/document/column_box.rb, line 132
    def add_right_padding(right_padding)
      @total_right_padding += right_padding
    end

bare_column_width() click to toggle source

The column width, not the width of the whole box, before left and/or right padding

    # File lib/prawn/document/column_box.rb, line 64
    def bare_column_width
      (@width - @spacer * (@columns - 1)) / @columns
    end

left() click to toggle source

Relative position of the left edge of the current column

    # File lib/prawn/document/column_box.rb, line 89
    def left
      width_of_column * @current_column
    end

left_side() click to toggle source

x coordinate of the left edge of the current column

    # File lib/prawn/document/column_box.rb, line 83
    def left_side
      absolute_left + (width_of_column * @current_column)
    end

move_past_bottom() click to toggle source

Moves to the next column or starts a new page if currently positioned at the rightmost column.

    # File lib/prawn/document/column_box.rb, line 108
    def move_past_bottom
      @current_column = (@current_column + 1) % @columns
      @document.y = @y
      if 0 == @current_column
        if @reflow_margins
          @y = @parent.absolute_top
        end
        @document.start_new_page
      end
    end

right() click to toggle source

Relative position of the right edge of the current column.

    # File lib/prawn/document/column_box.rb, line 102
    def right
      left + width
    end

right_side() click to toggle source

x co-orordinate of the right edge of the current column

    # File lib/prawn/document/column_box.rb, line 95
    def right_side
      columns_from_right = @columns - (1 + @current_column)
      absolute_right - (width_of_column * columns_from_right)
    end

subtract_left_padding(left_padding) click to toggle source

    # File lib/prawn/document/column_box.rb, line 127
    def subtract_left_padding(left_padding)
      @total_left_padding -= left_padding
      @x -= left_padding
    end

subtract_right_padding(right_padding) click to toggle source

    # File lib/prawn/document/column_box.rb, line 136
    def subtract_right_padding(right_padding)
      @total_right_padding -= right_padding
    end

width() click to toggle source

The column width after padding. Used to calculate how long a line of text can be.

    # File lib/prawn/document/column_box.rb, line 71
    def width
      bare_column_width - (@total_left_padding + @total_right_padding)
    end

width_of_column() click to toggle source

Column width including the spacer.

    # File lib/prawn/document/column_box.rb, line 77
    def width_of_column
      bare_column_width + @spacer
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.