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

Fix issue where we were not applying flex end correctly when justifying #41691

Closed
wants to merge 7 commits into from

Conversation

joevilches
Copy link
Contributor

Summary: The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Nov 29, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51383792

joevilches added a commit to joevilches/yoga that referenced this pull request Nov 29, 2023
Summary:
X-link: facebook/react-native#41691

The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792

fbshipit-source-id: 10021b605f13445334e9c640b69de0dc1cf6a674
@analysis-bot
Copy link

analysis-bot commented Nov 29, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 16,516,725 +3,065
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 19,891,417 +7,168
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 8081265
Branch: main

joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 4, 2023
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 4, 2023
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51383792

joevilches added a commit to joevilches/yoga that referenced this pull request Dec 4, 2023
…ng (facebook#1487)

Summary:
Pull Request resolved: facebook#1487

X-link: facebook/react-native#41691

The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792

fbshipit-source-id: 5b17d8503406d380d08a721e14ace22361c91cdf
joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 5, 2023
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51383792

joevilches added a commit to joevilches/yoga that referenced this pull request Dec 5, 2023
…ng (facebook#1487)

Summary:
Pull Request resolved: facebook#1487

X-link: facebook/react-native#41691

The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792

fbshipit-source-id: 4454c7eb438b96f53a38f51d2f2180f00eb5da23
joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 5, 2023
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51383792

joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 5, 2023
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 6, 2023
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 6, 2023
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51383792

joevilches added a commit to joevilches/yoga that referenced this pull request Dec 6, 2023
…ng (facebook#1487)

Summary:
Pull Request resolved: facebook#1487

X-link: facebook/react-native#41691

The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792

fbshipit-source-id: 744b38b0851e843d18540d5526c506f4b29862c6
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51383792

joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 6, 2023
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 7, 2023
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51383792

joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 7, 2023
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 7, 2023
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51383792

joevilches added a commit to joevilches/yoga that referenced this pull request Dec 7, 2023
…ng (facebook#1487)

Summary:
Pull Request resolved: facebook#1487

X-link: facebook/react-native#41691

The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792

fbshipit-source-id: d5fa5d5d0785535cb20831c8f6e705c5c369e7ad
joevilches added a commit to joevilches/yoga that referenced this pull request Dec 7, 2023
…ng (facebook#1487)

Summary:
Pull Request resolved: facebook#1487

X-link: facebook/react-native#41691

The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792

fbshipit-source-id: 4aaf909bfc702417ea8f83f2f288b159921c7929
joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 7, 2023
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51383792

joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 7, 2023
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
Joe Vilches and others added 7 commits December 7, 2023 14:40
…ng absolute node's position (facebook#41684)

Summary:
X-link: facebook/yoga#1481


Absolute nodes can be laid out by themselves and do not have to care about what is happening to their siblings. Because of this we can make `positionAbsoluteChild` the sole place where we handle this logic. Right now that is scattered around algorithm with many `if (child is absolute)` cases everywhere. This makes implementing position static a lot harder since we are relying on the CB to do all this work, not the parent.

With this change the only time we set position for an absolute node and it matter (i.e. not overwritten) is in `positionAbsoluteChild`

Reviewed By: NickGerleman

Differential Revision: D51290723
Summary:
X-link: facebook/yoga#1482


This is the final step (that I know of) to get the core features of static working. Here we turn on all of the tests and pass down the correct owner size for the call to `calculateLayoutInternal` that is in `layoutAbsoluteChild`

Reviewed By: NickGerleman

Differential Revision: D51293606
…ox (facebook#41686)

Summary:
X-link: facebook/yoga#1485


The size of the containing block is the size of the padding box of the containing node for absolute nodes. We were looking at  `containingNode->getLayout().measuredDimension(Dimension::Width)` which is the border box. So we need to subtract the border from this.

Added a test that was failing before this change as well

Reviewed By: NickGerleman

Differential Revision: D51330526
…book#41687)

Summary:
X-link: facebook/yoga#1484


Tsia. Added test and accounted for parent padding

Reviewed By: NickGerleman

Differential Revision: D51374086
…rtain case (facebook#41688)

Summary:
X-link: facebook/yoga#1486


Somehow missed this case. We never want to measure the CB as that gets border box but we want padding box

Reviewed By: NickGerleman

Differential Revision: D51376309
…ustifying (facebook#41690)

Summary:
X-link: facebook/yoga#1489


Centering involves centering the margin box in the content box of the parent, and then getting the distance from the flex start edge of the parent to the child

Reviewed By: NickGerleman

Differential Revision: D51383625
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51383792

joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 7, 2023
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
joevilches added a commit to joevilches/yoga that referenced this pull request Dec 7, 2023
…ng (facebook#1487)

Summary:
Pull Request resolved: facebook#1487

X-link: facebook/react-native#41691

The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792

fbshipit-source-id: bf19639b30c2376d7e28682f4b338a33041cdaf1
facebook-github-bot pushed a commit to facebook/litho that referenced this pull request Dec 8, 2023
Summary:
X-link: facebook/yoga#1487

X-link: facebook/react-native#41691

The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792

fbshipit-source-id: 372835a44edff361dbd84dd92ff9f2ec844b9f9c
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 579ef2b.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Dec 8, 2023
facebook-github-bot pushed a commit to facebook/yoga that referenced this pull request Dec 8, 2023
…ng (#1487)

Summary:
Pull Request resolved: #1487

X-link: facebook/react-native#41691

The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792

fbshipit-source-id: 372835a44edff361dbd84dd92ff9f2ec844b9f9c
Othinn pushed a commit to Othinn/react-native that referenced this pull request Jan 9, 2024
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487

Pull Request resolved: facebook#41691

The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792

fbshipit-source-id: 372835a44edff361dbd84dd92ff9f2ec844b9f9c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants