Method: Processing::GraphicsContext#push

Defined in:
lib/processing/graphics_context.rb

#push(&block) ⇒ Object

Save current styles and transformations to stack.

Returns:

  • (Object)

    result of the expression at the end of the block

See Also:



2495
2496
2497
2498
2499
2500
2501
# File 'lib/processing/graphics_context.rb', line 2495

def push(&block)
  pushMatrix
  pushStyle
  block.call if block
ensure
  pop if block
end