Class: Magick::RVG::ClipPath

Inherits:
Object
  • Object
show all
Includes:
Describable, Duplicatable, ShapeConstructors, Stylable, TextConstructors, UseConstructors
Defined in:
lib/rvg/clippath.rb

Instance Attribute Summary

Attributes included from Describable

#desc, #metadata, #title

Instance Method Summary collapse

Methods included from Duplicatable

#deep_copy

Methods included from Stylable

#styles

Methods included from TextConstructors

#text

Methods included from UseConstructors

#use

Methods included from ShapeConstructors

#circle, #ellipse, #line, #path, #polygon, #polyline, #rect

Constructor Details

#initialize(clip_path_units = 'userSpaceOnUse') {|_self| ... } ⇒ ClipPath

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.

Yields:

  • (_self)

Yield Parameters:

Raises:

  • (ArgumentError)


24
25
26
27
28
29
30
31
# File 'lib/rvg/clippath.rb', line 24

def initialize(clip_path_units = 'userSpaceOnUse')
  super()
  raise ArgumentError, "undefined value for clip path units: #{clip_path_units}" unless %w[userSpaceOnUse objectBoundingBox].include?(clip_path_units)

  @clip_path_units = clip_path_units
  @content = Content.new
  yield(self) if block_given?
end