class RVG::ClipPath < Object

Table of Contents

class methods


instance methods

shared methods

In addition to the methods listed above, class RVG::ClipPath also implements the styles method and the shape methods.

class methods

new [ { |clippath| drawing method calls } ] -> aClipPath


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 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.


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.


clipping path example

See Also

The :clip_rule style.


desc, desc=

clippath.desc -> aString
clippath.desc = aString


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

metadata, metadata=

clippath.metadata -> aString
clippath.metadata = aString


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

title, title=

clippath.title -> aString
clippath.title = aString


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

instance methods


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


Calls 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.


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


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


Calls 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.




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