Class: Magick::RVG::Ellipse
- Inherits:
-
Shape
- Object
- Shape
- Magick::RVG::Ellipse
- Defined in:
- lib/rvg/embellishable.rb
Overview
class Circle
Instance Method Summary collapse
-
#initialize(rx, ry, cx = 0, cy = 0) ⇒ Ellipse
constructor
Define an ellipse with a center at [
cx
,cy
], a horizontal radiusrx
and a vertical radiusry
.
Methods included from Duplicatable
Methods included from Transformable
#matrix, #rotate, #scale, #skewX, #skewY, #translate
Methods included from Stylable
Constructor Details
#initialize(rx, ry, cx = 0, cy = 0) ⇒ Ellipse
Define an ellipse with a center at [cx
, cy
], a horizontal radius rx
and a vertical radius ry
. Use the RVG::ShapeConstructors#ellipse method to create Ellipse objects in a container.
41 42 43 44 45 46 47 48 49 |
# File 'lib/rvg/embellishable.rb', line 41 def initialize(rx, ry, cx = 0, cy = 0) super() rx, ry, cx, cy = Magick::RVG.convert_to_float(rx, ry, cx, cy) raise ArgumentError, "radii must be >= 0 (#{rx}, #{ry} given)" if rx < 0 || ry < 0 @primitive = :ellipse # Ellipses are always complete. @args = [cx, cy, rx, ry, 0, 360] end |