Sets the dash pattern for stroked lines and curves
length is the length of the dash. If options is not present,
or options[:space] is nil, then length is also the length of
the space between dashes
options may contain :space and :phase
:space is the space between the dashes
:phase is where in the cycle to begin dashing. For
example, a phase of 0 starts at the beginning of
the dash; whereas, if the phase is equal to the
length of the dash, then stroking will begin at
the beginning of the space. Default is 0
integers or floats may be used for length and the options
dash units are in PDF points ( 1/72 in )
# File lib/prawn/graphics/dash.rb, line 31
31: def dash(length=nil, options={})
32: return current_dash_state || undash_hash if length.nil?
33:
34: self.current_dash_state = { :dash => length,
35: :space => options[:space] || length,
36: :phase => options[:phase] || 0 }
37:
38: write_stroke_dash
39: end
Returns when stroke is dashed, false otherwise
# File lib/prawn/graphics/dash.rb, line 52
52: def dashed?
53: current_dash_state != undashed_setting
54: end
# File lib/prawn/graphics/dash.rb, line 72
72: def current_dash_state
73: graphic_state.dash
74: end
# File lib/prawn/graphics/dash.rb, line 68
68: def current_dash_state=(dash_options)
69: graphic_state.dash = dash_options
70: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.