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
parent
commit
a42d874449
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 9
      src/Avalonia.Base/Media/Effects/DropShadowEffect.cs

9
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);
} }

Loading…
Cancel
Save