-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Re-implemented wpf shadow #998
Conversation
[ReactProp(ViewProps.ShadowColor, CustomType = "Color")] | ||
public void SetShadowColor(TFrameworkElement view, uint? color) | ||
{ | ||
DropShadowEffect effect = (DropShadowEffect)view.Effect ?? new DropShadowEffect(); |
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.
var
[ReactProp(ViewProps.ShadowOpacity)] | ||
public void SetShadowOpacity(TFrameworkElement view, double opacity) | ||
{ | ||
DropShadowEffect effect = (DropShadowEffect)view.Effect ?? new DropShadowEffect(); |
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.
var
[ReactProp(ViewProps.ShadowRadius)] | ||
public void SetShadowRadius(TFrameworkElement view, double radius) | ||
{ | ||
DropShadowEffect effect = (DropShadowEffect)view.Effect ?? new DropShadowEffect(); |
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.
var
[ReactProp(ViewProps.ShadowOffset)] | ||
public void SetShadowOffset(TFrameworkElement view, JObject offset) | ||
{ | ||
DropShadowEffect effect = (DropShadowEffect)view.Effect ?? new DropShadowEffect(); |
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.
var
DropShadowEffect effect = (DropShadowEffect)view.Effect ?? new DropShadowEffect(); | ||
var deltaX = offset.Value<double>("width"); | ||
var deltaY = offset.Value<double>("height"); | ||
var angle = Math.Atan2(deltaY, deltaX) * (180 / Math.PI); |
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.
180 [](start = 54, length = 3)
I'm pretty sure this returns a double anyway, but it may make sense to use 180.
@@ -84,6 +84,11 @@ public static class ViewProps | |||
public const string BorderBottomLeftRadius = "borderBottomLeftRadius"; | |||
public const string BorderBottomRightRadius = "borderBottomRightRadius"; | |||
|
|||
public const string ShadowColor = "shadowColor"; | |||
public const string ShadowOffset = "shadowOffset"; |
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.
Can we just inline the strings? I try to keep tis file in sync with https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.java. I should have put a comment along those lines in here.
* re-implemented wpf shadow * Addressing minor comments from review.
* re-implemented wpf shadow * Addressing minor comments from review.
* re-implemented wpf shadow * Addressing minor comments from review.
It not working |
This is very outdated code, I wouldn't expect it to work anymore. |
UWP implementation will have to be totally different, but for now this addresses the WPF side of #953