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

skewX, skewY does not work! #12212

Closed
Pourya8366 opened this issue Feb 4, 2017 · 22 comments
Closed

skewX, skewY does not work! #12212

Pourya8366 opened this issue Feb 4, 2017 · 22 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Pourya8366
Copy link

Pourya8366 commented Feb 4, 2017

Description

i styled a <View /> with transform: [{skewX: "-20deg"}] and it does nothing at all!
when i use skewY it do rotate!!!

Reproduction

https://rnplay.org/apps/FlXziw

Solution

i think it's a react native bug!

Additional Information

  • React Native version: 0.41.0
  • Platform: Android
  • Operating System: Windows
@glcrazier
Copy link

There is no built-in skew animation on Android anyway.

@lndgalante
Copy link

lndgalante commented Feb 16, 2017

Having the same problem here. The transform skewY does works, but if you add skewX then skewY stops working. Even using skewX only will not work.

I'm running everything on:

  • React Native version: 0.41.2
  • Platform: Android 4.4.4 API 19
  • Operating System: macOS 10.12.3

@roshangm1
Copy link
Contributor

I am having the same problem as @Fenwil . Any workarounds ?

@Pourya8366
Copy link
Author

@glcrazier there is a skew function in canvas library of android and it works there!

@glcrazier
Copy link

@Pourya8366 Cool, thanks for correction! I realized that matrix may do the work as well. Which function are you referring to in canvas library?

@roshangm1
Copy link
Contributor

@Pourya8366 hey did you find any workarounds ?

@Pourya8366
Copy link
Author

Pourya8366 commented Mar 3, 2017

@Pourya8366
Copy link
Author

@roshangm1 No, i found nothing yet! :(

@glcrazier
Copy link

it works for canvas, but it is not a good option for animation framework in my opinion. I noticed that in latest release this issue was resolved. You can take a shot

@roshangm1
Copy link
Contributor

roshangm1 commented Mar 4, 2017

@glcrazier I think, not yet resolved. :/ working fine for iOS. Problem with android.

@lndgalante
Copy link

@roshangm1 In v0.42 is fixed:
Fix skew transform on native side (c681959) - @MaxGraey
I didn't try it yet but I guess it works now

@roshangm1
Copy link
Contributor

roshangm1 commented Mar 5, 2017 via email

@MaxGraey
Copy link
Contributor

MaxGraey commented Mar 8, 2017

I confirm, for Android skew transform is not working.
Digging deep in ReactAndroid's sources I found the following:

  1. Code to transform the view is made very inefficient. In order to apply transformation matrix firstly decompose to scale/rotate/skew/translation and applied separately to view.setTranslationX, view.setTranslationY and etc.

  2. Android's view does't has methods for setSkewX and setSkewY at all. "setMatrix" absent as well!

So I see only two ways:

  1. Use view's setAnimationMatrix.
  2. Subclassing View to obtain direct access to private mRenderNode and his matrix property.

Both way need hard refactoring existing code

@lirui0407
Copy link

+1, skewX skewY still doesn't work.
Aug 1,2017

@pull-bot
Copy link

pull-bot commented Oct 9, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos added the Icebox label Oct 9, 2017
@hramos hramos closed this as completed Oct 9, 2017
@larspa
Copy link

larspa commented Nov 10, 2017

@MaxGraey I encountered the same problem and I wonder what kind of solution there is besides diving into the native code. I find it weird that only the skewX is not working while the skewY is.

@MaxGraey
Copy link
Contributor

Theoreticlly you can simulate 2d skew transform via 3d rotation by X and Y axis simultaneously with ortho projection

@dogofpavlov
Copy link

dogofpavlov commented May 22, 2018

Hmm, unfortunately a year and 3 months later, this is STILL not fixed. skewX doesn't work on Android, while skewY does. If you add a skewX, the skewY stops working

@huqiliang
Copy link

react-native": "0.55.4"

both skewX and skewY doesn't work on Android, is this issue solved ?

@yeomann
Copy link

yeomann commented Sep 18, 2018

same 0.57.0 still no progress i guess?

@RichardLindhout
Copy link

Not working +1 for this.

@Fortidude
Copy link

skewY and skewX not working on Android. ANy workaroud?

@facebook facebook locked as resolved and limited conversation to collaborators Oct 9, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests