Skip to content

Commit

Permalink
DropShadowDirectionEffect: add AffectsRender for ShadowDepthProperty …
Browse files Browse the repository at this point in the history
…and DirectionProperty (#17664)

* Update DropShadowEffect.cs

* Update DropShadowEffect.cs

---------

Co-authored-by: Julien Lebosquain <[email protected]>
  • Loading branch information
laolarou726 and MrJul authored Dec 3, 2024
1 parent da4be92 commit a42d874
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Avalonia.Base/Media/Effects/DropShadowEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ public double Direction

public double OffsetX => Math.Cos(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);
}
}

0 comments on commit a42d874

Please sign in to comment.