Class: Magick::RVG::Path
- Inherits:
-
Shape
- Object
- Shape
- Magick::RVG::Path
- Defined in:
- lib/rvg/embellishable.rb
Overview
class Line
Instance Method Summary collapse
-
#initialize(path) ⇒ Path
constructor
Define an SVG path.
Methods included from Duplicatable
Methods included from Transformable
#matrix, #rotate, #scale, #skewX, #skewY, #translate
Methods included from Stylable
Constructor Details
#initialize(path) ⇒ Path
Define an SVG path. The argument can be either a path string or a PathData object. Use the RVG::ShapeConstructors#path method to create Path objects in a container.
67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/rvg/embellishable.rb', line 67 def initialize(path) super() path = path.to_s # SVG path data is command letters, numbers, commas and whitespace only. # Anything else could close the MVG token that Draw#path wraps this in # and have the rest of the string executed as further MVG primitives. invalid = path[/[^MmZzLlHhVvCcSsQqTtAa0-9eE.,+\-\s]/] raise ArgumentError, "invalid character in path data (#{invalid.inspect} given)" if invalid @primitive = :path @args = [path] end |