Files
XCEngine/docs/api/math/viewport/getrect.md

19 lines
321 B
Markdown
Raw Normal View History

2026-03-20 02:35:15 +08:00
# Viewport::GetRect
```cpp
Rect GetRect() const
2026-03-20 02:35:15 +08:00
```
将视口转换为 Rect。
**返回:** `Rect` - 对应的矩形 (x, y, width, height),不包含深度范围
2026-03-20 02:35:15 +08:00
**复杂度:** O(1)
**示例:**
```cpp
Viewport viewport(0, 0, 1920, 1080, 0.0f, 1.0f);
Rect rect = viewport.GetRect(); // (0, 0, 1920, 1080)
2026-03-20 02:35:15 +08:00
```