This commit is contained in:
Christopher Blackman 2021-11-24 12:01:20 -05:00
Родитель 2c870ee285
Коммит 169e296e3e
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -212,6 +212,10 @@ namespace Microsoft.Toolkit.Uwp.UI.Media
return;
}
// 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.
// This will have the effect of clipping the inner content of the shadow, so that the casting element is not covered by the shadow,
// while the shadow is still rendered outside of the element. Similar to what takes place in GetVisualClip,
// except here we use a brush to mask content instead of a pure geometric clip.
var shapeVisual = context.GetResource(OpacityMaskShapeVisualResourceKey) ??
context.AddResource(OpacityMaskShapeVisualResourceKey, context.Compositor.CreateShapeVisual());