зеркало из https://github.com/AvaloniaUI/Avalonia.git
DropShadowDirectionEffect: add AffectsRender for ShadowDepthProperty and DirectionProperty (#17664)
* Update DropShadowEffect.cs * Update DropShadowEffect.cs --------- Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
This commit is contained in:
Родитель
da4be92fa0
Коммит
a42d874449
|
@ -99,6 +99,11 @@ public sealed class DropShadowDirectionEffect : DropShadowEffectBase, IDirection
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче