class Magick::RVG::ClipPath

Public Class Methods

new(clip_path_units='userSpaceOnUse') { |self| ... } click to toggle source

Create a clipping path. Within the block create an outline from one or more paths, basic shapes, text objects, or use. Everything drawn within the outline will be displayed. Anything drawn outside the outline will not.

If the clipping path contains a use, it must directly reference path, basic shape, or text objects.

Attach the clipping path to an object with the :clip_path style.

Calls superclass method Magick::RVG::Stylable.new
# File lib/rvg/clippath.rb, line 24
def initialize(clip_path_units='userSpaceOnUse')
    super()
    unless ['userSpaceOnUse', 'objectBoundingBox'].include?(clip_path_units)
        fail ArgumentError, "undefined value for clip path units: #{clip_path_units}"
    end
    @clip_path_units = clip_path_units
    @content = Content.new
    yield(self) if block_given?
end