CanvasIO.cropArea

Getter for the current crop area, if one is set. Any shape drawn is cropped to fit this area on the canvas.

This may be used by nodes to skip objects that are outside of the area. For this reason, a canvas system may (and should) provide a value corresponding to the entire canvas, even if no crop area has been explicitly set.

Returning an empty value may be desirable if the canvas is some form of persistent storage, like a printable document or vector image, where the entire content may be displayed all at once.

Crop area should be reset by Canvas I/O to its initial value before every frame.

  1. Optional!Rectangle cropArea()
    interface CanvasIO
    const nothrow
    Optional!Rectangle
    cropArea
    ()
  2. void cropArea(Rectangle area)
  3. void cropArea(Optional!Rectangle area)

Return Value

Type: Optional!Rectangle

An area on the canvas that shapes can be drawn in.

Meta