Module Magick::RVG::ShapeConstructors
In: lib/rvg/embellishable.rb
Enum GeometryValue Stylable RVG\n[lib/rvg/clippath.rb\nlib/rvg/container.rb\nlib/rvg/deep_equal.rb\nlib/rvg/describable.rb\nlib/rvg/embellishable.rb\nlib/rvg/misc.rb\nlib/rvg/paint.rb\nlib/rvg/pathdata.rb\nlib/rvg/rvg.rb\nlib/rvg/stretchable.rb\nlib/rvg/stylable.rb\nlib/rvg/text.rb\nlib/rvg/transformable.rb\nlib/rvg/units.rb] Transformable Stretchable Embellishable Describable Duplicatable Comparable Image ImageList Enumerable Geometry OptionalMethodArguments HatchFill Draw lib/rvg/paint.rb lib/RMagick.rb ObjectData Application Pre_ObjectData_Descriptor Envelope Post_ObjectData_Descriptor IPTC Magick dot/m_14_0.png

Methods that construct basic shapes within a container

Methods

circle   ellipse   line   path   polygon   polyline   rect  

Public Instance methods

Draws a circle whose center is [cx, cy] and radius is r.

[Source]

     # File lib/rvg/embellishable.rb, line 264
264:             def circle(r, cx=0, cy=0)
265:                 circle = Circle.new(r, cx, cy)
266:                 @content << circle
267:                 return circle
268:             end

Draws an ellipse whose center is [cx, cy] and having a horizontal radius rx and vertical radius ry.

[Source]

     # File lib/rvg/embellishable.rb, line 272
272:             def ellipse(rx, ry, cx=0, cy=0)
273:                 ellipse = Ellipse.new(rx, ry, cx, cy)
274:                 @content << ellipse
275:                 return ellipse
276:             end

Draws a line from [x1, y1] to [x2, y2].

[Source]

     # File lib/rvg/embellishable.rb, line 279
279:             def line(x1=0, y1=0, x2=0, y2=0)
280:                 line = Line.new(x1, y1, x2, y2)
281:                 @content << line
282:                 return line
283:             end

Draws a path defined by an SVG path string or a PathData object.

[Source]

     # File lib/rvg/embellishable.rb, line 287
287:             def path(path)
288:                 path = Path.new(path)
289:                 @content << path
290:                 return path
291:             end

Draws a polygon. The arguments are [x, y] pairs that define the points that make up the polygon. At least two points must be specified. If the last point is not the same as the first, adds an additional point to close the polygon.

[Source]

     # File lib/rvg/embellishable.rb, line 314
314:             def polygon(*points)
315:                 polygon = Polygon.new(*points)
316:                 @content << polygon
317:                 return polygon
318:             end

Draws a polyline. The arguments are [x, y] pairs that define the points that make up the polyline. At least two points must be specified.

[Source]

     # File lib/rvg/embellishable.rb, line 323
323:             def polyline(*points)
324:                 polyline = Polyline.new(*points)
325:                 @content << polyline
326:                 return polyline
327:             end

Draws a rectangle whose upper-left corner is [x, y] and with the specified width and height. Unless otherwise specified the rectangle has square corners. Returns a Rectangle object.

Draw a rectangle with rounded corners by calling the round method on the Rectangle object. rx and ry are the corner radii in the x- and y-directions. For example:

  canvas.rect(width, height, x, y).round(8, 6)

If ry is omitted it defaults to rx.

[Source]

     # File lib/rvg/embellishable.rb, line 303
303:             def rect(width, height, x=0, y=0)
304:                 rect = Rect.new(width, height, x, y)
305:                 @content << rect
306:                 return rect
307:             end

[Validate]