godotengine / godotengine/godot
`Control` nodes custom draw calls get culled incorrectly
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Reproducible in:
- v4.6.dev [bd2ca13c6] (master)
- v4.5.stable.official [876b29033]
### System information
Godot v4.6.dev (bd2ca13c6) - Nobara Linux 42 (KDE Plasma Desktop Edition) on Wayland - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (nvidia; 580.105.08) - AMD Ryzen 9 5900X 12-Core Processor (24 threads) - 31.25 GiB memory
### Issue description
Unlike other 2D nodes, control nodes always get culled according to their transform defined rect.
This makes custom draw calls using `_draw()` disappear too early.
https://github.com/user-attachments/assets/12147ae5-91e2-43dd-9126-0ed70303fbe0
### Steps to reproduce
1. Download and open the MRP.
2. Move the editor viewport so that the Control node called "Test" exits the viewport.
3. Alternatively, press play and watch the box disappear too early as it moves out of view.
### Minimal reproduction project (MRP)
[control-incorrect-cull.zip](https://github.com/user-attachments/files/23546274/control-incorrect-cull.zip)
Contributor guide
Research direction
Start with the attached control-incorrect-cull.zip minimal reproduction project and reproduce the disappearing custom draw call by moving the Test Control node or running the scene. Trace the Control node's _draw() behavior and the transform-defined-rect culling path. Done means the custom-drawn box remains visible until it actually leaves the viewport, without breaking normal Control rendering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, godot
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100