minus total outer flex basis for available width or height, when compute flex basis for children #858

Open
shiyizju wants to merge 1 commits from shiyizju/hotfix/1.10.1 into main
shiyizju commented 2019-01-30 01:58:46 -08:00 (Migrated from github.com)

I put an ImageView and an UILabel in a horizontal flex layout, the label's size is not calculated correctly. The size passed to UILabel's sizeThatFits is not correct. I think it should minus the previous calculated totalOuterFlexBasis.

Thanks.

I put an ImageView and an UILabel in a horizontal flex layout, the label's size is not calculated correctly. The size passed to UILabel's sizeThatFits is not correct. I think it should minus the previous calculated totalOuterFlexBasis. Thanks.
facebook-github-bot commented 2019-01-30 01:58:52 -08:00 (Migrated from github.com)

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. **If you are contributing on behalf of someone else (eg your employer)**, the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [cla@fb.com](mailto:cla@fb.com?subject=CLA%20for%20facebook%2Fyoga%20%23858). Thanks!
facebook-github-bot commented 2019-01-30 03:49:24 -08:00 (Migrated from github.com)

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!
woehrl01 commented 2019-01-31 09:49:03 -08:00 (Migrated from github.com)

Thanks @shiyizju for your pull request.

Could you please add a test case for this change, to prevent a possible regression?

Thanks!

Thanks @shiyizju for your pull request. Could you please add a test case for this change, to prevent a possible regression? Thanks!
shiyizju commented 2019-01-31 23:57:17 -08:00 (Migrated from github.com)

Thanks @shiyizju for your pull request.

Could you please add a test case for this change, to prevent a possible regression?

Thanks!

Thanks @woehrl01 for reply.

I ran the test cases and it failed with following output:

====STANDARD OUT====
tests/YGPersistenceTest.cpp:208: Failure
Expected: YGNodeGetChild(root2_child1, 0)
Which is: 0x7f8eb9809200
To be equal to: root_child1_0
Which is: 0x7f8eb9808c00
TESTS FAILED: 1 FAILURE
Failed target: //:YogaTests
FAIL //:YogaTests

I don't understand the test case very well referenced in the output, could you please help check if I miss something, or maybe my change is not correct?

Thanks.

> Thanks @shiyizju for your pull request. > > Could you please add a test case for this change, to prevent a possible regression? > > Thanks! Thanks @woehrl01 for reply. I ran the test cases and it failed with following output: ====STANDARD OUT==== tests/YGPersistenceTest.cpp:208: Failure Expected: YGNodeGetChild(root2_child1, 0) Which is: 0x7f8eb9809200 To be equal to: root_child1_0 Which is: 0x7f8eb9808c00 TESTS FAILED: 1 FAILURE Failed target: //:YogaTests FAIL //:YogaTests I don't understand the test case very well referenced in the output, could you please help check if I miss something, or maybe my change is not correct? Thanks.
woehrl01 commented 2019-02-01 00:13:53 -08:00 (Migrated from github.com)

To be honest, I'm not sure about this specific testcase. But it seems more of a bug in the cloning process.

It would be great if you use the existing /gentest/fixtures/YGFlexTest.html + /gentest/gentest.rb to generate a specific test scenario (see README#Testing).

Please keep in mind that there a vast amount of code at FB that depends on Yoga and thus it might not be possible to fix all bugs, due to introducing a breaking change.

To be honest, I'm not sure about this specific testcase. But it seems more of a bug in the cloning process. It would be great if you use the existing [/gentest/fixtures/YGFlexTest.html](https://github.com/facebook/yoga/tree/master/gentest/fixtures/YGFlexTest.html) + [/gentest/gentest.rb](https://github.com/facebook/yoga/tree/master/gentest/gentest/gentest.rb) to generate a specific test scenario (see [README#Testing](https://github.com/facebook/yoga#testing)). Please keep in mind that there a vast amount of code at FB that depends on Yoga and thus it might not be possible to fix all bugs, due to introducing a breaking change.
shiyizju commented 2019-02-01 20:41:58 -08:00 (Migrated from github.com)

I met this problem in iOS environments with YogaKit. Following I upload a demo to reproduce this problem, please take a look. Let me know if there is any problem. Thanks!

https://github.com/shiyizju/YogaTryout

I met this problem in iOS environments with YogaKit. Following I upload a demo to reproduce this problem, please take a look. Let me know if there is any problem. Thanks! https://github.com/shiyizju/YogaTryout
shiyizju commented 2019-02-12 19:31:33 -08:00 (Migrated from github.com)

Hi, @davidaurelio , could you please let me know if this issue is being followed up? Thanks.

Hi, @davidaurelio , could you please let me know if this issue is being followed up? Thanks.
davidaurelio commented 2020-06-19 14:57:10 -07:00 (Migrated from github.com)

@SidharthGuglani could you remove me as a reviewer here? Thanks!

@SidharthGuglani could you remove me as a reviewer here? Thanks!
This pull request has changes conflicting with the target branch.
  • yoga/Yoga.cpp
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin shiyizju/hotfix/1.10.1:shiyizju/hotfix/1.10.1
git checkout shiyizju/hotfix/1.10.1
Sign in to join this conversation.
No description provided.