Floating precision error causing oversized layout main dimension (totalFlexShrinkScaledFactors)
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 18.9k
- Forks
- 1.6k
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in yoga/algorithm/CalculateLayout.cpp at the linked line and inspect how totalFlexShrinkScaledFactors is checked after subtraction. Reproduce the extreme panel-resizing case that reaches zero width, then verify that the resulting layout no longer gets an oversized main dimension when the value is near zero.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100