Skip to content

Commit 169e296

Browse files
Add comment.
1 parent 2c870ee commit 169e296

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Microsoft.Toolkit.Uwp.UI.Media/Shadows/AttachedCardShadow.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ private void UpdateVisualOpacityMask(AttachedShadowElementContext context)
212212
return;
213213
}
214214

215+
// Create a rounded rectangle Visual with a thick outline and no fill, then use a VisualSurface of it as an opacity mask for the shadow.
216+
// This will have the effect of clipping the inner content of the shadow, so that the casting element is not covered by the shadow,
217+
// while the shadow is still rendered outside of the element. Similar to what takes place in GetVisualClip,
218+
// except here we use a brush to mask content instead of a pure geometric clip.
215219
var shapeVisual = context.GetResource(OpacityMaskShapeVisualResourceKey) ??
216220
context.AddResource(OpacityMaskShapeVisualResourceKey, context.Compositor.CreateShapeVisual());
217221

0 commit comments

Comments
 (0)