mySVGSVGElement.createSVGRect() in SVG 1.1
Creates and returns a new SVGRect element
- Return Type
- SVGRect
Description
This method of the root SVG element is the way to create a new SVGRect object. (Not to be confused with an SVGRectElement.) The returned rect has its
x
, y
, width
and height
properties set to 0. The following JS sample code assumes a reference to the SVGSVGElement named svgRoot:
var bounds = svgRoot.createSVGRect();
bounds.x=10;
bounds.y=10;
bounds.width=620;
bounds.height=460;
var fitsIn640By480 = svgRoot.checkEnclosure(someElement,bounds);