Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Microsoft.Toolkit.Uwp.UI/Shadows/AttachedDropShadow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,11 @@ protected override CompositionBrush GetShadowMask(AttachedShadowElementContext c
// Create a ShapeVisual so that our geometry can be rendered to a visual
var shapeVisual = context.GetResource(ShapeVisualResourceKey) ??
context.AddResource(ShapeVisualResourceKey, context.Compositor.CreateShapeVisual());
shapeVisual.Shapes.Add(shape);

if (!shapeVisual.Shapes.Contains(shape))
{
shapeVisual.Shapes.Add(shape);
}

// Create a CompositionVisualSurface, which renders our ShapeVisual to a texture
var visualSurface = context.GetResource(VisualSurfaceResourceKey) ??
Expand Down Expand Up @@ -344,6 +348,7 @@ protected internal override void OnSizeChanged(AttachedShadowElementContext cont
context.SpriteVisual.Offset = context.Element.CoordinatesFrom(CastTo).ToVector3();

UpdateShadowClip(context);
UpdateShadowMask(context);

base.OnSizeChanged(context, newSize, previousSize);
}
Expand Down