Sha256: 370ae53c095e2fbec4be93f2a4dc49543eb487aea8a077f300eeba1604c07852

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

# coding: utf-8

module ThinReports
  module Generator
    
    # @private
    class Pdf::Drawer::ListSection < Pdf::Drawer::Page
      # @param pdf (see Pdf::Drawer::Page#initialize)
      # @param section [ThinReports::Core::Shape::List::SectionInternal] section
      def initialize(pdf, section)
        super(pdf, section.format)
        @section       = section
        @stamp_created = false
      end
      
      # @param [ThinReports::Core::Shape::Manager::Internal] manager
      # @param [Array<Numeric>] at
      def draw(manager, at)
        @draw_at = at
        draw_section
        super(manager)
      end
      
    private
      
      def draw_section
        id = @format.identifier.to_s
        
        unless @stamp_created
          @pdf.create_stamp(id) do
            @pdf.parse_svg('<svg xmlns:xlink="http://www.w3.org/1999/xlink">' +
                           "#{@format.layout}</svg>", '/svg')
          end
          @stamp_created = true
        end
        pdf_stamp(id)
      end
      
      # @see ThinReports::Generator::Pdf::Drawer::Page#draw_tblock_shape      
      def draw_tblock_shape(shape)
        @pdf.translate(*@draw_at) { super }
      end
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thinreports-0.6.0.pre3 lib/thinreports/generator/pdf/drawer/list_section.rb