aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/api/domrect/fromrect/index.md
blob: 2a62e4b2c07720d4ec11f2e42da88bb1b5940581 (plain)
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
42
43
44
---
title: DOMRect.fromRect()
slug: Web/API/DOMRect/fromRect
tags:
  - API
  - DOMRect
  - Geometry
  - Method
  - Reference
browser-compat: api.DOMRect.fromRect
translation_of: Web/API/DOMRect/fromRect
---
{{APIRef("Geometry Interfaces")}}

{{domxref("DOMRect")}} 객체의 **`fromRect()`** 정적 메서드는 주어진 좌표와 크기를 가진 새로운 `DOMRect` 객체를 반환합니다.

## 구문

```js
DOMRect.fromRect(rectangle)
```

### 매개변수

- `rectangle` {{optional_inline}}

  - : 직사각형의 위치와 크기를 지정하는 객체입니다. 모든 속성의 기본 값은 `0`입니다. 포함할 수 있는 속성은 다음과 같습니다.

    - `x`: 직사각형 왼쪽 모서리의 좌표입니다.
    - `y`: 직사각형 위쪽 모서리의 좌표입니다.
    - `width`: 직사각형의 너비입니다.
    - `height`: 직사각형의 높이입니다.

### 반환 값

{{domxref("DOMRect")}} 인스턴스.

## 명세

{{Specifications}}

## 브라우저 호환성

{{Compat}}