Method: Wee::HtmlCanvas#nest

Defined in:
lib/wee/html_canvas.rb

#nestObject



17
18
19
20
21
22
23
24
25
# File 'lib/wee/html_canvas.rb', line 17

def nest
  old_brush = @current_brush
  # we don't want that Brush#close is calledas #nest
  # is called from #with -> this avoids an infinite loop
  @current_brush = nil 
  yield
  @current_brush.close if @current_brush
  @current_brush = old_brush
end