class Prawn::Document::MultiBox
A MultiBox is specified by 2 Boxes and spans the areas between.
@group Experimental API
Attributes
@private
Public Class Methods
Source
# File lib/prawn/grid.rb, line 299 def initialize(pdf, box1, box2) @pdf = pdf @boxes = [box1, box2] end
Public Instance Methods
Source
# File lib/prawn/grid.rb, line 364 def bottom bottom_box.bottom end
y-coordinate of the bottom.
@return [Float]
Source
# File lib/prawn/grid.rb, line 385 def bottom_left [left, bottom] end
x,y coordinates of bottom left corner.
@return [Array(Float, Float)]
Source
# File lib/prawn/grid.rb, line 392 def bottom_right [right, bottom] end
x,y coordinates of bottom right corner.
@return [Array(Float, Float)]
Source
# File lib/prawn/grid.rb, line 400 def bounding_box(&blk) pdf.bounding_box(top_left, width: width, height: height, &blk) end
Creates a standard bounding box based on the grid box.
@yield @return [void]
Source
# File lib/prawn/grid.rb, line 336 def gutter @boxes[0].gutter end
Width of the gutter.
@return [Float]
Source
# File lib/prawn/grid.rb, line 329 def height top_box.top - bottom_box.bottom end
Height of a box.
@return [Float]
Source
# File lib/prawn/grid.rb, line 343 def left left_box.left end
x-coordinate of left side.
@return [Float]
Source
# File lib/prawn/grid.rb, line 310 def name @boxes.map(&:name).join(':') end
Mostly diagnostic method that outputs the name of a box.
@return [String]
Source
# File lib/prawn/grid.rb, line 350 def right right_box.right end
x-coordinate of right side.
@return [Float]
Source
# File lib/prawn/grid.rb, line 408 def show(grid_color = 'CCCCCC') bounding_box do original_stroke_color = pdf.stroke_color pdf.stroke_color = grid_color pdf.text(name) pdf.stroke_bounds pdf.stroke_color = original_stroke_color end end
Drawn the box. Diagnostic method.
@param grid_color [Color] @return [void]
Source
# File lib/prawn/grid.rb, line 357 def top top_box.top end
y-coordinate of the top.
@return [Float]
Source
# File lib/prawn/grid.rb, line 371 def top_left [left, top] end
x,y coordinates of top left corner.
@return [Array(Float, Float)]
Source
# File lib/prawn/grid.rb, line 378 def top_right [right, top] end
x,y coordinates of top right corner.
@return [Array(Float, Float)]
Source
# File lib/prawn/grid.rb, line 315 def total_height @boxes[0].total_height end
@private
Source
# File lib/prawn/grid.rb, line 322 def width right_box.right - left_box.left end
Width of a box.
@return [Float]