Method: Processing::GraphicsContext#clip

Defined in:
lib/processing/graphics_context.rb

#clip(a, b, c, d) ⇒ nil

Limits the drawable rectangle.

The parameters a, b, c, and d are determined by rectMode().

Parameters:

  • a (Numeric)

    horizontal position of the drawable area, by default

  • b (Numeric)

    vertical position of the drawable area, by default

  • c (Numeric)

    width of the drawable area, by default

  • d (Numeric)

    height of the drawable area, by default

Returns:

  • (nil)

    nil



574
575
576
577
578
# File 'lib/processing/graphics_context.rb', line 574

def clip(a, b, c, d)
  x, y, w, h = toXYWH__ @imageMode__, a, b, c, d
  @painter__.clip x, y, w, h
  nil
end