Method: PDF::Writer::Graphics#fill

Defined in:
lib/pdf/writer/graphics.rb

#fill(rule = nil) ⇒ Object

Fills the path. Open subpaths are implicitly closed before being filled. PDF offers two methods for determining the fill region. The first is called the “nonzero winding number” and is the default fill. The second is called “even-odd”.

Use the even-odd rule (called with #fill(:even_odd)) with caution, as this will cause certain portions of the path to be considered outside of the fill region, resulting in interesting cutout patterns.



78
79
80
81
82
83
84
85
# File 'lib/pdf/writer/graphics.rb', line 78

def fill(rule = nil)
  if :even_odd == rule
    add_content(" f*")
  else
    add_content(" f")
  end
  self
end