Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floating precision error causing oversized layout main dimension (totalFlexShrinkScaledFactors) #1783

Open
Hexlord opened this issue Feb 6, 2025 · 1 comment

Comments

@Hexlord
Copy link

Hexlord commented Feb 6, 2025

There are cases where subtraction from totalFlexShrinkScaledFactors causes the value to apporach zero but not quite reach it, flexLine.layout.totalFlexShrinkScaledFactors == 0 should instead be <= 0.001
Happens only under extreme conditions (resizing panels to 0 width)

flexLine.layout.totalFlexShrinkScaledFactors == 0) {

@NickGerleman
Copy link
Contributor

We have yoga::inexactEquals that we could use for this. The way it works is a bit of a sledge hammer, but it's the right overall check here if we can accumulate FP error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants