###### RMagick 0.0.0 User's Guide and Reference

# class RVG::ClipPath < Object

## class methods

### new

RVG::ClipPath.new(clip_path_units) [ { |clippath| drawing method calls } ] -> clippath

#### Description

Creates a clipping path. A clipping path is a combination of path, text, and basic shape objects that define an outline. Attach the clipping path to an object such as a raster image or RVG object with the :clip_path style. When RVG draws the object, things "outside" the path are not drawn.

The ClipPath.new method yields to a block. Within the block define the clipping path with a combination of path, basic shape, and text objects. You can also use the use method to refer to a previously-defined object or group of objects.

#### Arguments

clip_path_units
  Defines the coordinate system for the contents of the clipping path. This argument can take either of two values, userSpaceOnUse, or objectBoundingBox. If `userSpaceOnUse`, the contents of the clipping path represent values in the current user coordinate system in place at the time when the clipping path is referenced. if objectBoundingBox, then the user coordinate system for the contents of the clipping path is established using the bounding box of the object to which the clipping path is applied. The default is `userSpaceOnUse`.

#### Example

#### See Also

The :clip_rule style.

## attributes

### desc, desc=

clippath.desc -> string
clippath.desc = string

#### Description

Use the `desc` attribute to assign a text description to the clipping path.

### metadata, metadata=

clippath.metadata -> string
clippath.metadata = string

#### Description

Use the `metadata` attribute to assign additional metadata to the clipping path.

### title, title=

clippath.title -> string
clippath.title = string

#### Description

Use the `title` attribute to assign a title to the clipping path.

## instance methods

### text

clippath.text(x=0, y=0, text=nil) [{|text| ...}] -> text

#### Description

Calls RVG::Text.new to construct a text object and adds it to the clipping path. Yields to a block if one is present, passing the new text object as an argument.

#### Returns

The `RVG::Text` object, so other `RVG::Text` methods can be chained to this method.

### use

clippath.use(obj, x=0, y=0, width=nil, height=nil) -> use

#### Description

Calls RVG::Use.new to constructs a `use` object and adds it to the clipping path.

When the referenced argument is another RVG object, width and height can be used to specify the width and height of the viewport. If present and non-nil, these arguments override any width and height specified when the RVG object was created. You must specify the viewport size either when creating the RVG object or when referencing it with `use`.

#### Examples

See RVG::Use.new

#### Returns

The `RVG::Use` object, so other `RVG::Use` methods can be chained to this method.