godotengine / godotengine/godot

`Control`'s `clip_contents` ignores camera rotation

Open
#87,902 7 comments 0 reactions 0 assignees View on GitHub
bug discussion topic:2d topic:gui
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

4.3.dev [17e7f85c06], 4.0.stable

### System information

Godot v4.3.dev - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 31.0.15.4601) - AMD Ryzen 9 3900X 12-Core Processor (24 Threads)

### Issue description

When rotating the camera, `Control`s will rotate, but the clipping rect for `clip_contents` ignores the rotation. It seems to grow the rect to respect the rotated size, but still adheres to the window's rotation.

![image](https://github.com/godotengine/godot/assets/21325943/99027189-fb69-40f8-9f27-395d98134726)

### Steps to reproduce

1. Add a `Camera2D`
2. Add a `Control` with something visible in it.
3. Select `clip_contents` on the `Control`
4. Rotate the camera

### Minimal reproduction project (MRP)

N/A

Contributor guide

Open the contributing guide

Research direction

Start with the listed Camera2D and Control reproduction steps, then trace the Control clip_contents behavior and its interaction with camera rotation. No source files or tests are named, and no minimal reproduction project is provided. Done means the clipping rect follows the camera rotation instead of expanding while retaining the unrotated window orientation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, godot
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.