Class: Thinreports::SectionReport::Renderer::StackViewRowRenderer

Inherits:
Object
  • Object
show all
Includes:
DrawItem, SectionHeight
Defined in:
lib/thinreports/section_report/pdf/renderer/stack_view_row_renderer.rb

Instance Method Summary collapse

Methods included from DrawItem

#draw_item

Methods included from SectionHeight

#calc_float_content_bottom, #calc_text_block_height, #image_block_layout, #item_layout, #section_height, #stack_view_layout, #static_layout, #text_layout

Constructor Details

#initialize(pdf) ⇒ StackViewRowRenderer

Returns a new instance of StackViewRowRenderer.



13
14
15
# File 'lib/thinreports/section_report/pdf/renderer/stack_view_row_renderer.rb', line 13

def initialize(pdf)
  @pdf = pdf
end

Instance Method Details

#render(row) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/thinreports/section_report/pdf/renderer/stack_view_row_renderer.rb', line 17

def render(row)
  doc = pdf.pdf

  actual_height = section_height(row)
  doc.bounding_box([0, doc.cursor], width: doc.bounds.width, height: actual_height) do
    row.items.each do |item|
      draw_item(item, (actual_height - row.schema.height))
    end
  end
end