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

Properly implement Start, End, FlexStart, and FlexEnd alignment variants #307

Closed
nicoburns opened this issue Dec 30, 2022 · 4 comments · Fixed by #336
Closed

Properly implement Start, End, FlexStart, and FlexEnd alignment variants #307

nicoburns opened this issue Dec 30, 2022 · 4 comments · Fixed by #336
Labels
breaking-change A change that breaks our public interface bug Something isn't working good first issue Good for newcomers

Comments

@nicoburns
Copy link
Collaborator

nicoburns commented Dec 30, 2022

When refactoring the alignment types to work with CSS Grid, I couldn't work out what the difference between start/end and flex-start/flex-end was. I came to the conclusion that they were just aliases of each other, and folded them into one. It turns out that this works for Grid, but it is wrong for Flexbox. The difference is:

  • flex-start/flex-end are effected by FlexDirection (the RowReverse and ColumnReverse directions flip them.
  • start/end are not effected by FlexDirection.

Currently we have variants called Start and End that behave like FlexStart and FlexEnd. We ought to add new variants for this use case, and alter start/end to work as per the spec.

This probably isn't hugely high priority unless someone complains about it because I doubt many people are using RowReverse/ColumnReverse.

@nicoburns nicoburns added bug Something isn't working good first issue Good for newcomers breaking-change A change that breaks our public interface labels Dec 30, 2022
@Weibye
Copy link
Collaborator

Weibye commented Dec 30, 2022

This is probably going to be more prominent of an issue once taffy starts supporting multiple writing directions and orientations.

That being said, we did use RowReverse a lot in Bevy since we had an inverse coordinate system until quite recently, which is not unthinkable that other users of Taffy do as well.

@nicoburns nicoburns added this to the 0.3 milestone Dec 30, 2022
@nicoburns
Copy link
Collaborator Author

This is probably going to be more prominent of an issue once taffy starts supporting multiple writing directions and orientations.

Actually, it's orthogonal to that. These properties are both effected by e.g. setting an RTL direction. But there's an additional level of indirection based on flex-direction for the flex-prefixed variants.

That being said, we did use RowReverse a lot in Bevy since we had an inverse coordinate system until quite recently

Ah, in that case we probably ought to fix this prior to releasing 0.3.

@Weibye
Copy link
Collaborator

Weibye commented Dec 30, 2022

That being said, we did use RowReverse a lot in Bevy since we had an inverse coordinate system until quite recently

Ah, in that case we probably ought to fix this prior to releasing 0.3.

It was reverted in this PR, and released in Bevy 0.9 so it might not be very pressing to solve this, at least not for Bevy's usage.

That being said, the nuances of these layout algorithms are so complex that any time we can improve the "strictness" and clarity of the various types and how to use them makes the crate so much easier to work with.

@alice-i-cecile
Copy link
Collaborator

Yeah, I'd like to fix this before the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change A change that breaks our public interface bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants