class Prawn::SVG::Elements::Root

Public Class Methods

new(document, source = document.root, parent_calls = [], state = ::Prawn::SVG::State.new) click to toggle source
Calls superclass method Prawn::SVG::Elements::Base.new
# File lib/prawn/svg/elements/root.rb, line 2
def initialize(document, source = document.root, parent_calls = [], state = ::Prawn::SVG::State.new)
  super
end

Public Instance Methods

apply() click to toggle source
# File lib/prawn/svg/elements/root.rb, line 10
def apply
  add_call 'fill_color', '000000'
  add_call 'transformation_matrix', @document.sizing.x_scale, 0, 0, @document.sizing.y_scale, 0, 0
  add_call 'transformation_matrix', 1, 0, 0, 1, -@document.sizing.x_offset, @document.sizing.y_offset
end
container?() click to toggle source
# File lib/prawn/svg/elements/root.rb, line 16
def container?
  true
end
parse() click to toggle source
# File lib/prawn/svg/elements/root.rb, line 6
def parse
  state.viewport_sizing = @document.sizing
end