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 RTL in AbsoluteLayout #7309

Merged
merged 8 commits into from May 23, 2022
Merged

Fix RTL in AbsoluteLayout #7309

merged 8 commits into from May 23, 2022

Conversation

rachelkang
Copy link
Contributor

@rachelkang rachelkang commented May 18, 2022

Description of Change

Fix RTL in AbsoluteLayout. Now, setting RTL on AbsoluteLayout will actually right-align its children. Yay!
Thank you EZ for all the layout knowledge and help

Issues Fixed

Fixes #6540

@rachelkang rachelkang requested a review from hartez May 18, 2022
@rachelkang rachelkang added this to the 6.0.300-servicing milestone May 18, 2022
@jsuarezruiz jsuarezruiz added the area/layout 🔲 label May 19, 2022
@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented May 19, 2022

/azp run

@azure-pipelines
Copy link

azure-pipelines bot commented May 19, 2022

Azure Pipelines successfully started running 2 pipeline(s).

@rachelkang rachelkang enabled auto-merge (squash) May 19, 2022
bool leftToRight = AbsoluteLayout.ShouldArrangeLeftToRight();

// Figure out where we're starting from (the left edge of the padded area, or the right edge)
double xPosition = leftToRight ? padding.Left + bounds.Left : bounds.Right - padding.Right;
Copy link
Contributor

@samhouts samhouts May 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to reuse left and right here, since they seem to match?

Copy link
Contributor Author

@rachelkang rachelkang May 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely, thanks for catching that!

var measuredSize = manager.Measure(double.PositiveInfinity, 100);
manager.ArrangeChildren(new Rect(Point.Zero, measuredSize));

// We expect that the view hould be arranged on the right
Copy link
Contributor

@samhouts samhouts May 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// We expect that the view hould be arranged on the right
// We expect that the view should be arranged on the right

Copy link
Contributor

@samhouts samhouts May 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phew, glad I was here.
TheOfficeMichaelScottGIF

Copy link
Contributor Author

@rachelkang rachelkang May 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thank you! 😂

@rachelkang rachelkang requested a review from samhouts May 20, 2022
Copy link
Contributor

@hartez hartez left a comment

Remove the xPosition value if it's not needed. Otherwise, looks good!

src/Core/src/Layouts/AbsoluteLayoutManager.cs Outdated Show resolved Hide resolved
@rachelkang rachelkang requested a review from hartez May 23, 2022
hartez
hartez approved these changes May 23, 2022
@rachelkang rachelkang merged commit 347751a into main May 23, 2022
20 of 23 checks passed
@rachelkang rachelkang deleted the fix-6540 branch May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/layout 🔲
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants