Method: Magick::RVG::ShapeConstructors#rect

Defined in:
lib/rvg/embellishable.rb

#rect(width, height, x = 0, y = 0) ⇒ Object

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.

[View source]

303
304
305
306
307
# File 'lib/rvg/embellishable.rb', line 303

def rect(width, height, x=0, y=0)
    rect = Rect.new(width, height, x, y)
    @content << rect
    return rect
end