class Demo::CairoFillAndStroke

Public Class Methods

new() click to toggle source
Calls superclass method
# File gtk2/sample/gtk-demo/cairo-fill-and-stroke.rb, line 15
def initialize
  super('cairo fill and stroke')
end

Public Instance Methods

draw(cr) click to toggle source
# File gtk2/sample/gtk-demo/cairo-fill-and-stroke.rb, line 19
def draw(cr)
  cr.move_to(0.5, 0.1)
  cr.line_to(0.9, 0.9)
  cr.rel_line_to(-0.4, 0.0)
  cr.curve_to(0.2, 0.9, 0.2, 0.5, 0.5, 0.5)
  cr.close_path
  
  cr.set_source_rgba(0, 0, 1)
  cr.fill_preserve
  cr.set_source_rgba(0, 0, 0)
  cr.stroke
end