Class: Prawn::SVG::State

Inherits:
Object
  • Object
show all
Defined in:
lib/prawn/svg/state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeState

Returns a new instance of State.



9
10
11
12
13
14
15
# File 'lib/prawn/svg/state.rb', line 9

def initialize
  @stroke_width = 1
  @opacity = 1
  @last_fill_opacity = 1
  @last_stroke_opacity = 1
  @computed_properties = Prawn::SVG::Properties.new.load_default_stylesheet
end

Instance Attribute Details

#computed_propertiesObject

Returns the value of attribute computed_properties.



2
3
4
# File 'lib/prawn/svg/state.rb', line 2

def computed_properties
  @computed_properties
end

#inside_clip_pathObject

Returns the value of attribute inside_clip_path.



2
3
4
# File 'lib/prawn/svg/state.rb', line 2

def inside_clip_path
  @inside_clip_path
end

#inside_useObject

Returns the value of attribute inside_use.



2
3
4
# File 'lib/prawn/svg/state.rb', line 2

def inside_use
  @inside_use
end

#last_fill_opacityObject

Returns the value of attribute last_fill_opacity.



2
3
4
# File 'lib/prawn/svg/state.rb', line 2

def last_fill_opacity
  @last_fill_opacity
end

#last_stroke_opacityObject

Returns the value of attribute last_stroke_opacity.



2
3
4
# File 'lib/prawn/svg/state.rb', line 2

def last_stroke_opacity
  @last_stroke_opacity
end

#opacityObject

Returns the value of attribute opacity.



2
3
4
# File 'lib/prawn/svg/state.rb', line 2

def opacity
  @opacity
end

#preserve_spaceObject

Returns the value of attribute preserve_space.



2
3
4
# File 'lib/prawn/svg/state.rb', line 2

def preserve_space
  @preserve_space
end

#stroke_widthObject

Returns the value of attribute stroke_width.



2
3
4
# File 'lib/prawn/svg/state.rb', line 2

def stroke_width
  @stroke_width
end

#textObject

Returns the value of attribute text.



2
3
4
# File 'lib/prawn/svg/state.rb', line 2

def text
  @text
end

#viewport_sizingObject

Returns the value of attribute viewport_sizing.



2
3
4
# File 'lib/prawn/svg/state.rb', line 2

def viewport_sizing
  @viewport_sizing
end

Instance Method Details

#disable_drawingObject



21
22
23
# File 'lib/prawn/svg/state.rb', line 21

def disable_drawing
  inside_clip_path
end

#initialize_dup(_other) ⇒ Object



17
18
19
# File 'lib/prawn/svg/state.rb', line 17

def initialize_dup(_other)
  @computed_properties = @computed_properties.dup
end