flexbox-layout
flexbox-layout copied to clipboard
problem with flexBasisPercent
- [ ] I have searched existing issues and confirmed this is not a duplicate
Issues and steps to reproduce
Please replace this with steps to reproduce your issue. when use property flexBasisPercent,if result produce by the flexbox's width multiply by flexBasisPercent and it decimal part greater than 0.5f, the child's width will be a little greater.This will cause line feed.
Expected behavior
Please describe what you expected would happen. For example,the flexbox's width is 970, then set the child's flexBasisPercent is 0.25f , the result of child's width will be 243 but the exact width is 242.5 and the forth child is put to second line.Guess the reason is the code below. I wonder if there's any way to solve this problem.
Version of the flexbox library
0.3.2, and 1.0.0 has the same issue
Link to code
Please link to the code we can use to reproduce this issue. if (flexItem.getFlexBasisPercent() != FLEX_BASIS_PERCENT_DEFAULT && mainMode == View.MeasureSpec.EXACTLY) { childMainSize = Math.round(mainSize * flexItem.getFlexBasisPercent()); // Use the dimension from the layout if the mainMode is not // MeasureSpec.EXACTLY even if any fraction value is set to // layout_flexBasisPercent. } A complete project we can build/run is preferred, if you can't provide one, please show us relevant code
I have the same problem to。When I set the child's flexBasisPercent is 0.50f, the result of child's width will be greater than parent width 50% about 0.5px. And this problem just appear some special devices like HTC U11+.
I also have this problem on Samsung A50 in landscape. (flexbox version 1.1.1) Any updates?