-
Notifications
You must be signed in to change notification settings - Fork 23.2k
Expand file tree
/
Copy pathindex.md
More file actions
41 lines (28 loc) · 1.48 KB
/
index.md
File metadata and controls
41 lines (28 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
title: SVGRect
slug: Web/API/SVGRect
page-type: web-api-interface
browser-compat: api.SVGRect
---
{{APIRef("SVG")}}
The **`SVGRect`**, an alias for {{DOMXref("DOMRect")}}, represents a rectangle. Rectangles consist of an `x` and `y` coordinate pair identifying a minimum `x` value, a minimum `y` value, and a `width` and `height`, which are constrained to be non-negative.
An `SVGRect` object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
## Instance properties
- {{domxref("SVGRect.x")}}
- : The exact effect of this coordinate depends on each element. If the attribute is not specified, the effect is as if a value of `0` were specified.
- {{domxref("SVGRect.y")}}
- : The exact effect of this coordinate depends on each element. If the attribute is not specified, the effect is as if a value of `0` were specified.
- {{domxref("SVGRect.width")}}
- : This represents the width of the rectangle. A value that is negative results to an error. A value of `0` disables rendering of the element
- {{domxref("SVGRect.height")}}
- : This represents the height of the rectangle. A value that is negative results to an error. A value of `0` disables rendering of the element.
## Instance methods
None.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{DOMXref("DOMRect")}}
- {{DOMXref("DOMPoint")}} alias {{DOMXref("SVGPoint")}}
- {{DOMXref("DOMMatrix")}} alias {{DOMXref("SVGMatrix")}}