SVGRectElement in SVG 1.1

Represents a <rect ... /> element.

Inherits from:

For official information please see http://www.w3.org/TR/SVG11/shapes.html#RectElement.

Instance Properties

name type description
width SVGAnimatedLength (read only)
height SVGAnimatedLength (read only)
rx SVGAnimatedLength (read only)
ry SVGAnimatedLength (read only)
y SVGAnimatedLength (read only) The location of the top of the element.
x SVGAnimatedLength (read only) The location of the left side of the element.

Instance Methods

name returns description
addEventListener() (none) [from EventTarget]
removeEventListener() (none) [from EventTarget]
dispatchEvent() Boolean Dispatches an event to the invoking object. [from EventTarget]

Description

The 'rect' element defines a rectangle which is axis-aligned with the current user coordinate system. Rounded rectangles can be achieved by setting appropriate values for attributes rx and ry. If a properly specified value is provided for rx but not for ry, then the user agent processes the 'rect' element with the effective value for ry as equal to rx. If a properly specified value is provided for ry but not for rx, then the user agent processes the 'rect' element with the effective value for rx as equal to ry. If neither rx nor ry has a properly specified value, then the user agent processes the 'rect' element as if no rounding had been specified, resulting in square corners. If rx is greater than half of the width of the rectangle, then the user agent processes the 'rect' element with the effective value for rx as half of the width of the rectangle. If ry is greater than half of the height of the rectangle, then the user agent processes the 'rect' element with the effective value for ry as half of the height of the rectangle. Do not confuse this object, which corresponds to a <rect ... /> element in SVG, with the SVGRect object. (The latter is used internally to represent a rectangle for various properties, method arguments, and return types.)