-
Notifications
You must be signed in to change notification settings - Fork 25k
Export rotation property for views #423
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
Changes from all commits
bcf2368
a5fb130
1bff03c
85c33b5
b4e7e41
0bd79d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,6 +82,16 @@ - (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(RCTSparseArray *) | |
| RCT_REMAP_VIEW_PROPERTY(shadowOpacity, layer.shadowOpacity, CGFloat) | ||
| RCT_REMAP_VIEW_PROPERTY(shadowRadius, layer.shadowRadius, CGFloat) | ||
| RCT_REMAP_VIEW_PROPERTY(transformMatrix, layer.transform, CATransform3D) | ||
| RCT_CUSTOM_VIEW_PROPERTY(rotation, CGFloat, RCTView) | ||
| { | ||
| if (json) { | ||
| CGFloat angle = [RCTConvert CGFloat:json]; | ||
| CGAffineTransform transform = CGAffineTransformRotate(view.transform, angle); | ||
| view.transform = transform; | ||
| } else { | ||
| view.transform = defaultView.transform; | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does the else block need to be here?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fisherwebdev it might not be needed, I suppose. My understanding was that it would reset the |
||
| } | ||
| RCT_CUSTOM_VIEW_PROPERTY(overflow, css_overflow, RCTView) | ||
| { | ||
| view.clipsToBounds = json ? ![RCTConvert css_overflow:json] : defaultView.clipsToBounds; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @vjeux do you think we should use degrees instead of radians?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I think it would be nice to take radians by default and provide
degrees()andradians()functions in JavaScript to do the appropriate conversions