godotengine / godotengine/godot

SubViewport (with Size2D override stretch on) in collapsed split container causes affine_invert det==0 error

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

Description

### Tested versions

v4.3.stable.mono.official [77dcf97d8]

### System information

Godot v4.3.stable.mono - Windows 10.0.22631 - Vulkan (Forward+) - integrated Intel(R) Iris(R) Xe Graphics (Intel Corporation; 32.0.101.6077) - 12th Gen Intel(R) Core(TM) i5-12500H (16 Threads)

### Issue description

I put a subviewport in a VSplitContainer with Size2D override stretch on.

When collapsed it keeps throwing

```
E 0:00:01:0230 affine_invert: Condition "det == 0" is true.
core/math/transform_2d.cpp:51 @ affine_invert()
```

The error is gone if I turn off Size2D override stretch.

Or disable subviewport updating before collapsing (try uncommenting the code in the script).

### Steps to reproduce

In editor:

Check collapsed on `VSplitContainer`

Or run the game and click toggle collapsed

### Minimal reproduction project (MRP)

[subviewportissue.zip](https://github.com/user-attachments/files/17349170/subviewportissue.zip)

Contributor guide

Open the contributing guide

Research direction

Run the attached minimal reproduction project with Size2D override stretch enabled, then inspect core/math/transform_2d.cpp at affine_invert (line 51) and trace the SubViewport/VSplitContainer collapse path. Done means collapsing the container no longer produces the reported affine_invert det == 0 error while the affected configuration remains enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, godot
Domain
computer-graphics
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.