Option to support only rounded values #184
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I would like to support an option that the calculated values support only rounded value, e.g. instead "206.5" returned "207".
See
fe5c0d2d06/React/Views/RCTShadowView.m (L95-L161)
for how it is done in React Native in order to not suffer from precision loss.I didn't have great success in using the code vom React Native.
I'm trying to move to the current code base.
I have added some rounding code to our own code some months ago (old code base).
Do you mind adding a flag (as "experimental feature" is now added), to have rounding code inside css-layout?
This is the changes I added to support rounding to full numbers and distribute the remaining space over the childs. The things added are
rest
,add
and theMath.Floor
. This is C# code if you're wondering.Thanks @woehrl01 I'm interested in pursuing this but don't have the time currently. If you submit a pull request i'm more than happy to have a look.
@emilsjolander yeah, I would provide a PR. Just want to ask in front, if there is a veto against ;)
@woehrl01 Nope! I really want this feature. I might have objections and questions to the exact implementation and I expect it may take a bit to review but the core concept is good. Looking forward to your contributions 👍
Just had a look at the new layout code, I forgot that it that it changed fundamentaly due to the more W3C compliant implementation 😆 . Give me a few days, until I can dig a little deeper to find the necessary spots. 😉