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
Member

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 21:53
@rachelkang rachelkang added this to the 6.0.300-servicing milestone May 18, 2022
@jsuarezruiz jsuarezruiz added the area/layout 🔲 StackLayout, GridLayout, ScrollView, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label May 19, 2022
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@rachelkang rachelkang enabled auto-merge (squash) May 19, 2022 16:09
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
Member

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
Member Author

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
Member

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
Member

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
Member Author

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 15:12
Copy link
Contributor

@hartez hartez left a comment

Choose a reason for hiding this comment

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

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 13:59
@rachelkang rachelkang merged commit 347751a into main May 23, 2022
@rachelkang rachelkang deleted the fix-6540 branch May 23, 2022 15:36
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/layout 🔲 StackLayout, GridLayout, ScrollView, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RTL is not working in AbsoluteLayout
4 participants