X Tutup
Skip to content

Fix SplitContainer set desired size infinite loop#114541

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
kitbdev:fix-sc-inf-loop
Jan 3, 2026
Merged

Fix SplitContainer set desired size infinite loop#114541
akien-mga merged 1 commit intogodotengine:masterfrom
kitbdev:fix-sc-inf-loop

Conversation

@kitbdev
Copy link
Contributor

@kitbdev kitbdev commented Jan 3, 2026

The checks in SplitContainer::_set_desired_sizes fixes the infinite loop.
The problem was the available space / shrink amount got to a small number like 1.2e-5 where is_zero_approx didn't catch it but subtracting it resulted in no change. There is now a check to make sure that the available space changes. There is another check in the similar loop below it since it can have the same issue.

Unrelated to the inf loop, the split offset was being changed when changing from a scene collection source to an atlas source.
This happened because the atlas was being shown before the scene collection was hidden, which made the SplitContainer try fit all 3 children, shrinking them, before it went down to 2 visible children. Since the order matters now I changed it to show only after hiding.

@kitbdev kitbdev added this to the 4.6 milestone Jan 3, 2026
@kitbdev kitbdev added the bug label Jan 3, 2026
@kitbdev kitbdev requested a review from a team as a code owner January 3, 2026 00:19
@kitbdev kitbdev requested a review from a team January 3, 2026 00:19
@akien-mga akien-mga merged commit b8e4523 into godotengine:master Jan 3, 2026
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@kitbdev kitbdev deleted the fix-sc-inf-loop branch January 3, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Engine freeze when switching between SceneCollection and AtlasSource in TileMap tab

3 participants

X Tutup