File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Microsoft.Toolkit.Uwp.UI/Shadows Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,11 @@ protected override CompositionBrush GetShadowMask(AttachedShadowElementContext c
290
290
// Create a ShapeVisual so that our geometry can be rendered to a visual
291
291
var shapeVisual = context . GetResource ( ShapeVisualResourceKey ) ??
292
292
context . AddResource ( ShapeVisualResourceKey , context . Compositor . CreateShapeVisual ( ) ) ;
293
- shapeVisual . Shapes . Add ( shape ) ;
293
+
294
+ if ( ! shapeVisual . Shapes . Contains ( shape ) )
295
+ {
296
+ shapeVisual . Shapes . Add ( shape ) ;
297
+ }
294
298
295
299
// Create a CompositionVisualSurface, which renders our ShapeVisual to a texture
296
300
var visualSurface = context . GetResource ( VisualSurfaceResourceKey ) ??
@@ -344,6 +348,7 @@ protected internal override void OnSizeChanged(AttachedShadowElementContext cont
344
348
context . SpriteVisual . Offset = context . Element . CoordinatesFrom ( CastTo ) . ToVector3 ( ) ;
345
349
346
350
UpdateShadowClip ( context ) ;
351
+ UpdateShadowMask ( context ) ;
347
352
348
353
base . OnSizeChanged ( context , newSize , previousSize ) ;
349
354
}
You can’t perform that action at this time.
0 commit comments