Sha256: 2300a3038dea0d6c649314a02fe20ebd07a1302af431b46b1088f0361285e689

Contents?: true

Size: 551 Bytes

Versions: 6

Compression:

Stored size: 551 Bytes

Contents

module Prawn
  class DocumentBuilder
    class Layout
      def initialize(builder, document)
        @builder  = builder
        @document = document
      end

      attr_reader :builder, :document

      def remaining_space
        Prawn::Document::BoundingBox.new(
          document.bounds, [0,document.cursor], 
          :width  => document.bounds.width, 
          :height => document.cursor
        )
      end

      def overflow(command)
        document.start_new_page
        builder.commands.unshift(command)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
goodwill-prawn-edge-0.10.0 lib/prawn/document_builder/layout.rb
alphasights-prawn-0.10.4 lib/prawn/document_builder/layout.rb
alphasights-prawn-0.10.3 lib/prawn/document_builder/layout.rb
alphasights-prawn-0.10.2 lib/prawn/document_builder/layout.rb
alphasights-prawn-0.10.1 lib/prawn/document_builder/layout.rb
alphasights-prawn-0.10.0 lib/prawn/document_builder/layout.rb