Browse Source
DropShadowDirectionEffect: add AffectsRender for ShadowDepthProperty and DirectionProperty (#17664)
* Update DropShadowEffect.cs
* Update DropShadowEffect.cs
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
pull/16577/merge
laolarou
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
7 additions and
2 deletions
-
src/Avalonia.Base/Media/Effects/DropShadowEffect.cs
|
|
@ -99,6 +99,11 @@ public sealed class DropShadowDirectionEffect : DropShadowEffectBase, IDirection |
|
|
|
|
|
|
|
|
public double OffsetX => Math.Cos(Direction * Math.PI / 180) * ShadowDepth; |
|
|
public double OffsetX => Math.Cos(Direction * Math.PI / 180) * ShadowDepth; |
|
|
public double OffsetY => Math.Sin(Direction * Math.PI / 180) * ShadowDepth; |
|
|
public double OffsetY => Math.Sin(Direction * Math.PI / 180) * ShadowDepth; |
|
|
|
|
|
|
|
|
|
|
|
static DropShadowDirectionEffect() |
|
|
|
|
|
{ |
|
|
|
|
|
AffectsRender<DropShadowDirectionEffect>(ShadowDepthProperty, DirectionProperty); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public IImmutableEffect ToImmutable() => new ImmutableDropShadowDirectionEffect(OffsetX, OffsetY, BlurRadius, Color, Opacity); |
|
|
public IImmutableEffect ToImmutable() => new ImmutableDropShadowDirectionEffect(OffsetX, OffsetY, BlurRadius, Color, Opacity); |
|
|
} |
|
|
} |
|
|
|