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

Flip perspective-origin declarations #167

Conversation

elchininet
Copy link
Contributor

At the moment, perspective-origin is not flipped. As this declaration has a similar syntax as transform-origin, it is easy to include it in the current transform origin processor. The tests have been copied from the transform-origin ones, removing the cases that are not compatible with perspective-origin syntax.

@elchininet elchininet force-pushed the flip_perspective_origin_declarations branch from e370404 to fe94d11 Compare May 21, 2020 17:41
@elchininet elchininet force-pushed the flip_perspective_origin_declarations branch from fe94d11 to 23c0b28 Compare May 21, 2020 17:45
@MohammadYounes
Copy link
Owner

@elchininet Apologies for the late response, I was very overloaded lately.

I don't think perspective-origin is something that should be auto flipped, it should be left to the author to decide to flip or not.

Using MDN sample, This is what you get with and without flipping perspective-origin:

image

image

The samples do not reflect a real world scenario though! Do you happen to have a real use-case I can apply this on ?

@elchininet
Copy link
Contributor Author

Hi @MohammadYounes,

Do not worry, this is not something urgent ;)

You are right, I didn't think on an element with multiple faces like the example on MDN. My use case was simpler, a regular 2D transformation and I noticed that rotateY transformations and perspective-origin were not flipped, so I did it manually. It was something like this:

LTR: https://jsfiddle.net/elchininet/zunkwt82/
RTL: https://jsfiddle.net/elchininet/awodq0vn/

I also was preparing a merge request for rotateY, but now, thinking in these kinds of cases, forcing it by default could be conflictive too and it should be left to the author to decide if flip it or not.

What do you think about these properties? Do you think that it could be provided by a configuration parameter, or do you think that these cases should not be covered at all?

@elchininet
Copy link
Contributor Author

I discovered something, the examples on the MDN were also using rotateY, if those parameters are also flipped this is the result:

image

@MohammadYounes
Copy link
Owner

@elchininet The last one you shared is a more accurate

image

I believe this requires thorough investigation to ensure correct output when auto flipping transforms.

@elchininet
Copy link
Contributor Author

I agree @MohammadYounes, my CSSs files are not good enough because they only have easy 2D transformations, this should be tested with complex transformations. To make this test easier, do you want me to push also the rotateY change in this merge request?

@MohammadYounes
Copy link
Owner

@elchininet I'm not sure at the moment, Looking at the code, rotateY was explicitly excluded. We need to double check what should/shouldn't be auto flipped

@MohammadYounes MohammadYounes merged commit be838c0 into MohammadYounes:master Aug 15, 2020
@elchininet elchininet deleted the flip_perspective_origin_declarations branch May 9, 2021 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants