Class: Magick::RVG::Circle

Inherits:
Shape
  • Object
show all
Defined in:
lib/rvg/embellishable.rb

Overview

class Shape

Instance Method Summary collapse

Methods inherited from Shape

#add_primitives

Methods included from Duplicatable

#deep_copy

Methods included from Transformable

#matrix, #rotate, #scale, #skewX, #skewY, #translate

Methods included from Stylable

#styles

Constructor Details

#initialize(r, cx = 0, cy = 0) ⇒ Circle

Define a circle with radius r and centered at [cx, cy]. Use the RVG::ShapeConstructors#circle method to create Circle objects in a container.



30
31
32
33
34
35
36
37
38
39
# File 'lib/rvg/embellishable.rb', line 30

def initialize(r, cx=0, cy=0)
    super()
    r, cx, cy = Magick::RVG.convert_to_float(r, cx, cy)
    if r < 0
        raise ArgumentError, "radius must be >= 0 (#{r} given)"
    end
    @primitive = :circle
    @args = [cx, cy, cx+r, cy]
    self
end